git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Remove TCO test
commitc3b56cf82867396046541c1ff4e8f95289b32636 authorGary Burgess <gary.burgess@gmail.com> dateSat 26 Jul 2014, 14:48 (12 years ago) parentd2ba55c
1 file changed−27
examples/shouldpass/NewtypeTCO.purs−27
examples/shouldpass/NewtypeTCO.pursdeleted−27
@@ -1,27 +0,0 @@
1−module Main where
2−
3−newtype Id = Id forall a. a -> a
4−
5−runId = \id a -> case id of
6− Id f -> f a
7−
8−newtype Nat = Nat forall r. r -> (r -> r) -> r
9−
10−runNat = \nat -> case nat of
11− Nat f -> f 0 (\n -> n + 1)
12−
13−zero = Nat (\zero _ -> zero)
14−
15−succ = \n -> case n of
16− Nat f -> Nat (\zero succ -> succ (f zero succ))
17−
18−add = \n m -> case n of
19− Nat f -> case m of
20− Nat g -> Nat (\zero succ -> g (f zero succ) succ)
21−
22−one = succ zero
23−two = succ zero
24−four = add two two
25−fourNumber = runNat four
26−
27−main = Debug.Trace.trace "Done"