comparison tests/recBad.lac @ 238:44a1663ad893

Checking for well-formed 'val rec'
author Adam Chlipala <adamc@hcoop.net>
date Thu, 28 Aug 2008 13:13:16 -0400
parents
children fc6f04889bf2
comparison
equal deleted inserted replaced
237:9182068c9d7c 238:44a1663ad893
1 datatype list a = Nil | Cons of a * list a
2
3 val rec append : t ::: Type -> list t -> list t -> list t = fn t ::: Type => fn ls1 => fn ls2 =>
4 case ls1 of
5 Nil => ls2
6 | Cons (h, t) => Cons (h, append t ls2)
7
8 (*val rec ones : list int = Cons (1, ones)*)
9 val rec ones : unit -> list int = fn () => Cons (1, ones ())