sheen

Types

pub type ParseResult(a) =
  Result(a, List(ParseError))
pub type Parser(a) {
  Parser(
    spec: ParserSpec,
    encoders: endec.Encoders,
    decoder: endec.Decoder(a),
  )
}

Constructors

  • Parser(
      spec: ParserSpec,
      encoders: endec.Encoders,
      decoder: endec.Decoder(a),
    )
pub type ParserSpec {
  ParserSpec(
    cmd: command.CommandSpec,
    name: option.Option(String),
    authors: List(String),
    version: option.Option(String),
  )
}

Constructors

  • ParserSpec(
      cmd: command.CommandSpec,
      name: option.Option(String),
      authors: List(String),
      version: option.Option(String),
    )

Functions

pub fn authors(
  to parser: ParserSpec,
  set authors: List(String),
) -> ParserSpec
pub fn build(
  from parser: ParserSpec,
  with build_fn: fn(Builder(Nil)) -> Result(Builder(a), String),
) -> Result(Parser(a), String)
pub fn name(
  to parser: ParserSpec,
  set name: String,
) -> ParserSpec
pub fn new() -> ParserSpec
pub fn run(
  parser: Parser(a),
  args: List(String),
) -> Result(a, List(ParseError))
pub fn valid(value: a) -> Decoder(a)
pub fn version(
  to parser: ParserSpec,
  set version: String,
) -> ParserSpec
Search Document