Mercurial > urweb
comparison lib/top.ur @ 412:df4cbd90a26e
Infering sum rows
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 21 Oct 2008 19:31:11 -0400 |
parents | 06fcddcd20d3 |
children | ad7e854a518c |
comparison
equal
deleted
inserted
replaced
411:06fcddcd20d3 | 412:df4cbd90a26e |
---|---|
29 (f : nm :: Name -> rest :: {Unit} | 29 (f : nm :: Name -> rest :: {Unit} |
30 -> fn [[nm] ~ rest] => | 30 -> fn [[nm] ~ rest] => |
31 tf -> tr rest -> tr ([nm] ++ rest)) | 31 tf -> tr rest -> tr ([nm] ++ rest)) |
32 (i : tr []) = | 32 (i : tr []) = |
33 fold [fn r :: {Unit} => $(mapUT tf r) -> tr r] | 33 fold [fn r :: {Unit} => $(mapUT tf r) -> tr r] |
34 (fn (nm :: Name) (t :: Unit) (rest :: {Unit}) (acc : $(mapUT tf rest) -> tr rest) | 34 (fn (nm :: Name) (t :: Unit) (rest :: {Unit}) acc |
35 [[nm] ~ rest] (r : $([nm = tf] ++ mapUT tf rest)) => | 35 [[nm] ~ rest] r => |
36 f [nm] [rest] r.nm (acc (r -- nm))) | 36 f [nm] [rest] r.nm (acc (r -- nm))) |
37 (fn _ => i) | 37 (fn _ => i) |
38 | 38 |
39 fun foldTR (tf :: Type -> Type) (tr :: {Type} -> Type) | 39 fun foldTR (tf :: Type -> Type) (tr :: {Type} -> Type) |
40 (f : nm :: Name -> t :: Type -> rest :: {Type} | 40 (f : nm :: Name -> t :: Type -> rest :: {Type} |