gbr/shared/try

Types

pub type From(t, error) =
  Result(t, error)
pub type In(t, error) =
  Result(t, Try(error))
pub type Stack =
  List(String)
pub type Try(error) {
  Try(error: error, stack: List(String))
}

Constructors

  • Try(error: error, stack: List(String))
pub type Wrapper(error) =
  error

Values

pub fn context(
  in try: Result(t, Try(error)),
  with context: String,
) -> Result(t, Try(error))
pub fn map(
  in try: Result(t, Try(error)),
  map parser: fn(t) -> c,
) -> Result(c, Try(error))
pub fn map_error(
  in try: Result(t, Try(error)),
  map mapper: fn(error) -> error_map,
) -> Result(t, Try(error_map))
pub fn new(
  from result: Result(t, error),
) -> Result(t, Try(error))
pub fn print(
  in try: Try(error),
  like describe: fn(error) -> String,
) -> String
pub fn print_line(
  try: Try(error),
  like describe: fn(error) -> String,
) -> String
pub fn unwrap(in try: Result(t, Try(error))) -> Result(t, error)
pub fn with_context(
  error_context: String,
  next: fn() -> Result(a, Try(b)),
) -> Result(a, Try(b))
pub fn wrap(
  in try: Result(t, Try(error)),
  map parser: fn(Result(t, error)) -> Result(a, b),
  like describe: fn(Try(error)) -> String,
) -> Result(a, Try(b))
Search Document