trace 2
f x is if x=0 then g x else h x where g x is x+100 and h x is x-500
f 10
\
f x is h x where g x is if x=0 then 100 else h x-1 and
h x is if x=0 then 200 else g x-1
f 1
f 2
f 3
\
f x is g x where g x is if x=0 then 0 else g x-1
f 3
\
fac n is if n=0 then 1 else f n where f x is x*fac x-1
fac 5
\
f x is if x=0 then 2 else g x where g x is if x=0 then -5 else g x-1
f 5
\
f x is if x=0 then g x else h x where g x is x+1 and h x is x-1
f 3
\
k x is h x where h y is y+x
k 3
fac n is if n=0 then 1 else f n where f x is x*fac x-1
fac 5
\
\
fac n is if n=0 then 1 else f n where f x is x*fac x-1
fac 5
\
foo x y z is x+y-z
(((foo 10)3)4
[1;2;3]+[10;3;4]
f x is x+g x where g x is x*4
f 13
ff x is x+g x where g x is x*x
ff 13
fff x is g x where g x is x*x
fff 13
k x is h x where h y is y+x
k 3
l x is (h x)x where h y z is y+z
l 3
\
f a is a+h a where h x is x+a
f 13
trace 1
fac n is if n=0 then 1 else n*fac n-1
fac 5
\
(2+3)*5
goo x is x+g x where g x is x*4
goo 13
goo x is x+g x where g x is x*4
goo 13
\
map f l is if ~#l then [] else f x:map f xs
where x is hd l and xs is tl l
(map -:)[1 2 3]
\
hd [[1 2;3 4 5];10]
\
\
one is 1:two
two is 2:one
\
\
trace 0
foo x is x+n where n is 3
foo 4
goo x is x+g x where g x is x*4
goo 13
\
trace 0
fac n is if n=0 then 1 else n*fac n-1
fac 5
one is 1:two
two is 2:one
first n l is if (~n)|~#l then [] else x:(first n-1)xs
where x is *l and xs is 1_ l
(first 2)[1;2;3;4]
\
length l is if ~#l then 0 else 1+length 1 _ l
length 1 2 3
first x y is x
(first 10)20
\
*[1;2;!-1]
\
foo x is if ~x then x else foo x-1
foo 3
\
foo x is print x+1
print 3
\
hoo x is x
goo x is foo x-1
foo x is if ~x then 0 else goo x
foo 0
foo 12
\
goo x is x+12
foo x is goo x-1
foo 3
\
foo x is foo x-1
foo 3
\
2+3
\
goo x is 0
hoo x is x - 1
foo x is if ~x then goo x else hoo x
foo 0
foo 12
\
foo x is 2+x
goo x is x-14
goo 13
\
twice f x is f f x
incr x is x+1
tt x is (twice incr)x
tt 0
\
length l is if ~#l then 0 else 1+length 1 _ l
length 1 2 3
\
(2+3)*4
(2+3)*+/-!3
\
first x y is x
bomb n is !-1
[first 1+2 3*4;first 42 bomb 0]
\
twice f x is f f x
incr x is x+1
tt x is (twice incr)x
tt 3
\
[;;1 2 3]
[[];[]]
[1;2;[3 4 5]]
[]
[;;3]
2+--3
twice f x is f f x
incr x is x+1
tt x is (twice incr)x
tt 0
uu x is twice}incr x
uu 3
vv x is incr{twice x
uu 5