Mercurial > urweb
diff demo/list.ur @ 823:669ac5e9a69e
Demo compiles with pattern-matching-fu
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 28 May 2009 10:35:25 -0400 |
parents | 7ef4b2911b09 |
children |
line wrap: on
line diff
--- a/demo/list.ur Thu May 28 10:16:50 2009 -0400 +++ b/demo/list.ur Thu May 28 10:35:25 2009 -0400 @@ -1,6 +1,6 @@ datatype list t = Nil | Cons of t * list t -fun length (t ::: Type) (ls : list t) = +fun length [t] (ls : list t) = let fun length' (ls : list t) (acc : int) = case ls of @@ -10,7 +10,7 @@ length' ls 0 end -fun rev (t ::: Type) (ls : list t) = +fun rev [t] (ls : list t) = let fun rev' (ls : list t) (acc : list t) = case ls of