Mercurial > urweb
diff 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 |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/recBad.lac Thu Aug 28 13:13:16 2008 -0400 @@ -0,0 +1,9 @@ +datatype list a = Nil | Cons of a * list a + +val rec append : t ::: Type -> list t -> list t -> list t = fn t ::: Type => fn ls1 => fn ls2 => + case ls1 of + Nil => ls2 + | Cons (h, t) => Cons (h, append t ls2) + +(*val rec ones : list int = Cons (1, ones)*) +val rec ones : unit -> list int = fn () => Cons (1, ones ())