dataprep

Types

List guaranteed to have at least one element. Used by Invalid to ensure every failure carries at least one error. See dataprep/non_empty_list for construction and traversal.

pub type NonEmptyList(a) =
  non_empty_list.NonEmptyList(a)

Infallible transformation: fn(a) -> a. Always succeeds, never produces errors. See dataprep/prep for composition (then, sequence) and built-in preps (trim, lowercase, etc.).

pub type Prep(a) =
  fn(a) -> a

Applicative result with error accumulation. Valid(a) on success, Invalid(NonEmptyList(e)) on failure. See dataprep/validated for map, and_then, and map2..map5 for combining independent fields.

pub type Validated(a, e) =
  validated.Validated(a, e)

Check without transformation: fn(a) -> Validated(a, e). If v(x) returns Valid(y), then x == y. See dataprep/validator for builders (check, predicate) and combinators (both, all, alt, guard).

pub type Validator(a, e) =
  fn(a) -> validated.Validated(a, e)
Search Document