git.iko.soy/rowtype-yoga/purescript-native
on e82e607 help sign in
24 lines 439 B history raw
1module Main where
3import Prelude
5test1 arr = arr !! 0 + arr !! 1 + 1
7test2 = \arr -> case arr of
8 [x, y] -> x + y
9 [x] -> x
10 [] -> 0
11 (x : y : _) -> x + y
13data Tree = One Number | Some [Tree]
15test3 = \tree sum -> case tree of
16 One n -> n
17 Some (n1 : n2 : rest) -> test3 n1 sum * 10 + test3 n2 sum * 5 + sum rest
19test4 = \arr -> case arr of
20 [] -> 0
21 [_] -> 0
22 x : y : xs -> x * y + test4 xs
24main = Debug.Trace.trace "Done"