Skip to content

bwireman/gleither

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

21 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)
}