dhall-nix-lib/Number/clamp.dhall

11 lines
264 B
Text
Raw Normal View History

2022-08-31 17:51:53 +00:00
λ(nix : ../NixPrelude.dhall) →
let Number = ./Type.dhall
let Number/fromNatural = ./fromNatural.dhall nix
let Number/lessThan = ./lessThan.dhall nix
let zero = Number/fromNatural 0
in λ(a : Number) → if Number/lessThan a zero then zero else a