Gleither ↔️

A small data-structure for representing an Either Monad. Written in the excellent gleam ✨ language. Supporting both Erlang & Javascript targets

test commits mit PRs Welcome

Docs: https://hexdocs.pm/gleither/

gleam add gleither
import gleither.{Left, Right, map, get}

pub fn main() {
  Right(1)
  |> map(fn(x) { x + 1 })
  |> get()
  // Some(2)
}

fn ex() {
  Left(1)
  |> map(fn(x) { x + 1 })
  |> get()
  // Some(1)
}
Search Document