Gleither ↔️
A small data-structure for representing an Either Monad. Written in the excellent gleam ✨ language. Supporting both Erlang & Javascript targets
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)
}