comparison demo/sum.ur @ 633:03ab853c8e4b

Folder generation for functions
author Adam Chlipala <adamc@hcoop.net>
date Tue, 24 Feb 2009 15:38:01 -0500
parents 6c4643880df5
children aa2290c32ce2
comparison
equal deleted inserted replaced
632:6c4643880df5 633:03ab853c8e4b
2 foldUR [int] [fn _ => int] 2 foldUR [int] [fn _ => int]
3 (fn (nm :: Name) (rest :: {Unit}) [[nm] ~ rest] n acc => n + acc) 3 (fn (nm :: Name) (rest :: {Unit}) [[nm] ~ rest] n acc => n + acc)
4 0 [fs] fl x 4 0 [fs] fl x
5 5
6 fun main () = return <xml><body> 6 fun main () = return <xml><body>
7 {[sum Folder.nil {}]}<br/> 7 {[sum {}]}<br/>
8 {[sum (Folder.cons [#A] [()] ! (Folder.cons [#B] [()] ! Folder.nil)) {A = 0, B = 1}]}<br/> 8 {[sum {A = 0, B = 1}]}<br/>
9 {[sum (Folder.cons [#D] [()] ! (Folder.cons [#C] [()] ! (Folder.cons [#E] [()] ! Folder.nil))) {C = 2, D = 3, E = 4}]} 9 {[sum {C = 2, D = 3, E = 4}]}
10 </body></xml> 10 </body></xml>