git.iko.soy/rowtype-yoga/purescript-native
on 136cd21 help sign in
13 lines 289 B history raw
1test1 = \arr -> arr[0] + arr[1]
3test2 = \arr -> case arr of
4 [x, y] -> x + y
5 [x] -> x
6 [] -> 0
7 [x, y : _] -> x + y
9data Tree = One Number | Some [Tree]
11test3 = \tree, sum -> case tree of
12 One n -> n
13 Some [n1, n2 : rest] -> test3(n1, sum) * 10 + test3(n2, sum) * 5 + sum(rest)