LO
Size: a a a
LO
AA
dec map : (alpha -> beta)#list alpha -> list beta2)
--- map(f, nil) <= nil
--- map(f, a::al) <= (f a)::map(f, al)
zip x = hd x=()->()3)
map hd x:zip(map tl x)
letref x,y = x,y4)
in if x > y loop x := x - y
if x < y loop y := y - x
else x;;
max :- returns the largest element5)
max [a] = a
max [a,b] = a, a >= b
= b
max (a:x) = max [a,max x]
let rec type * list <=> () + * # ( * list)6)
with nil = abslist(inl ())
and cons x l = abslist(inr(x,l))
and null l = isl(replist l)
and hd l = fst(outr(replist l))
and tl l = snd(outr(replist l));
rec type Tree *a = empty + node (Tree *a) *a (Tree *a)7)
let fact_iter n =
let acc = ref 1 in frec n where rec
frec = function 0 -> !acc | n -> acc:=!acc*n; frec(n-1)
D
АГ
AA
A
AA
A
dec map : (alpha -> beta)#list alpha -> list beta2)
--- map(f, nil) <= nil
--- map(f, a::al) <= (f a)::map(f, al)
zip x = hd x=()->()3)
map hd x:zip(map tl x)
letref x,y = x,y4)
in if x > y loop x := x - y
if x < y loop y := y - x
else x;;
max :- returns the largest element5)
max [a] = a
max [a,b] = a, a >= b
= b
max (a:x) = max [a,max x]
let rec type * list <=> () + * # ( * list)6)
with nil = abslist(inl ())
and cons x l = abslist(inr(x,l))
and null l = isl(replist l)
and hd l = fst(outr(replist l))
and tl l = snd(outr(replist l));
rec type Tree *a = empty + node (Tree *a) *a (Tree *a)7)
let fact_iter n =
let acc = ref 1 in frec n where rec
frec = function 0 -> !acc | n -> acc:=!acc*n; frec(n-1)
LO
АГ
A
dec map : (alpha -> beta)#list alpha -> list beta2)
--- map(f, nil) <= nil
--- map(f, a::al) <= (f a)::map(f, al)
zip x = hd x=()->()3)
map hd x:zip(map tl x)
letref x,y = x,y4)
in if x > y loop x := x - y
if x < y loop y := y - x
else x;;
max :- returns the largest element5)
max [a] = a
max [a,b] = a, a >= b
= b
max (a:x) = max [a,max x]
let rec type * list <=> () + * # ( * list)6)
with nil = abslist(inl ())
and cons x l = abslist(inr(x,l))
and null l = isl(replist l)
and hd l = fst(outr(replist l))
and tl l = snd(outr(replist l));
rec type Tree *a = empty + node (Tree *a) *a (Tree *a)7)
let fact_iter n =
let acc = ref 1 in frec n where rec
frec = function 0 -> !acc | n -> acc:=!acc*n; frec(n-1)
AA
LO
LO
AA
Oℕ
AA
LO
Oℕ
Oℕ