dhall-nix-lib/Number/clamp.dhall

10 lines
264 B
Text

λ(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