Mercurial > urweb
diff demo/tcSum.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 | aa2290c32ce2 |
children | 8d3aa6c7cee0 |
line wrap: on
line diff
--- a/demo/tcSum.ur Thu May 28 10:16:50 2009 -0400 +++ b/demo/tcSum.ur Thu May 28 10:35:25 2009 -0400 @@ -1,6 +1,6 @@ -fun sum (t ::: Type) (_ : num t) (fs ::: {Unit}) (fl : folder fs) (x : $(mapU t fs)) = +fun sum [t] (_ : num t) [fs ::: {Unit}] (fl : folder fs) (x : $(mapU t fs)) = foldUR [t] [fn _ => t] - (fn (nm :: Name) (rest :: {Unit}) [[nm] ~ rest] n acc => n + acc) + (fn [nm :: Name] [rest :: {Unit}] [[nm] ~ rest] n acc => n + acc) zero [fs] fl x fun main () = return <xml><body>