sift/float

Float validators — range and positivity checks.

Values

pub fn between(
  lo: Float,
  hi: Float,
  msg: String,
) -> fn(Float) -> Result(Float, String)

Value must be between lo and hi (inclusive)

pub fn max(
  n: Float,
  msg: String,
) -> fn(Float) -> Result(Float, String)

Value must be <= n

pub fn min(
  n: Float,
  msg: String,
) -> fn(Float) -> Result(Float, String)

Value must be >= n

pub fn positive(
  msg: String,
) -> fn(Float) -> Result(Float, String)

Value must be > 0.0

Search Document