sheen/validate

Types

pub type ValidationError =
  String
pub type ValidationResult(a) =
  Result(a, ValidationError)
pub type Validator(a) =
  fn(ValidatorInput) -> ValidationResult(a)
pub type ValidatorInput {
  ValidatorInput(
    flags: dict.Dict(String, Int),
    named: dict.Dict(String, List(String)),
    args: List(String),
    subcommands: dict.Dict(String, ValidatorInput),
  )
}

Constructors

  • ValidatorInput(
      flags: dict.Dict(String, Int),
      named: dict.Dict(String, List(String)),
      args: List(String),
      subcommands: dict.Dict(String, ValidatorInput),
    )

Functions

pub fn extract(
  validator: fn(ValidatorInput) -> Result(a, String),
  cont: fn(a) -> fn(ValidatorInput) -> Result(b, String),
) -> fn(ValidatorInput) -> Result(b, String)
Search Document