comparison demo/sum.ur @ 631:effa7d43aac3

Make folders abstract
author Adam Chlipala <adamc@hcoop.net>
date Tue, 24 Feb 2009 14:04:07 -0500
parents f4f2b09a533a
children 6c4643880df5
comparison
equal deleted inserted replaced
630:6a6eb9882d57 631:effa7d43aac3
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] fold x 4 0 [fs] fold x
5 5
6 fun main () = return <xml><body> 6 fun main () = return <xml><body>
7 {[sum Folder.nil {}]}<br/> 7 {[sum Folder.nil {}]}<br/>
8 {[sum (Folder.cons [#A] [()] (Folder.cons [#B] [()] Folder.nil)) {A = 0, B = 1}]}<br/> 8 {[sum (Folder.cons [#A] [()] ! (Folder.cons [#B] [()] ! Folder.nil)) {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 (Folder.cons [#D] [()] ! (Folder.cons [#C] [()] ! (Folder.cons [#E] [()] ! Folder.nil))) {C = 2, D = 3, E = 4}]}
10 </body></xml> 10 </body></xml>