Bindings to native Erlang tuples
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src/Erl/Data
test
Makefile
README.md
psc-package.json

README.md

purescript-erl-tuples

Bindings to native Erlang tuples

Given an Erlang tuple {42, "foo", true} represent this directly as Erl.Data.Tuple.Tuple3 Int String Boolean. Create a tuple via tuple3 :: a -> b -> c -> Tuple3 a b c. Consume via uncurry3 or to pattern match, convert to Data.Tuple.Nested with toNested3.

add3 :: Data.Erl.Tuple.Tuple3 Int Int Int -> Int
add3 = toNested3 >> case _ of
  x /\ (y /\ z) -> x + y + z