pietervdvn / Lang

Yet another programming language
1 stars 1 forks source link

Wanted libraries #62

Open pietervdvn opened 9 years ago

pietervdvn commented 9 years ago
pietervdvn commented 9 years ago

Simple pipe operators

-- function composition
"abc". append "def" . append "ghi" = "abcdefghi"
-- functor composition
[1,2,3] | +64 | chr  = "abc"
-- applicative composition
[1,2,3] |> [(+3),( * 2)] = [4,5,6,2,4,6]
-- monad composition: fmap + join. Also known as >>=
[1,2,3] |>> (\i -> i*[i]\)     = [1,2,2,3,3,3]
[1,2,3] | (\i -> i*[i]\) .join = [ [1], [2,2], [3,3,3]].join = [1,2,2,3,3,3]
[1,2,3] >> ['a','b','c']        = "abc"
print "abc" >> return 42 = 42
g b $ f a $ 1 + 1 = g b (f a 2)
pietervdvn commented 9 years ago

Graph Lib

pietervdvn commented 9 years ago

Collections