diff options
author | 2008-10-21 19:24:39 -0400 | |
---|---|---|
committer | 2008-10-21 19:24:39 -0400 | |
commit | 17b3f5af99c07d7361fb99124412aff1768cfe13 (patch) | |
tree | fcfbcfaf492be1aa13c484eea28cfedaf565ed6c /lib/top.urs | |
parent | d66bb9f256db65e3487dec361a4a5a9d7ee238b0 (diff) |
Sum demo, minus inference of {Unit}s
Diffstat (limited to 'lib/top.urs')
-rw-r--r-- | lib/top.urs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/top.urs b/lib/top.urs index bf26d534..abdb7477 100644 --- a/lib/top.urs +++ b/lib/top.urs @@ -6,6 +6,9 @@ con sndTT = fn t :: (Type * Type) => t.2 con mapTT = fn f :: Type -> Type => fold (fn nm t acc [[nm] ~ acc] => [nm = f t] ++ acc) [] +con mapUT = fn f :: Type => fold (fn nm t acc [[nm] ~ acc] => + [nm = f] ++ acc) [] + con mapT2T = fn f :: (Type * Type) -> Type => fold (fn nm t acc [[nm] ~ acc] => [nm = f t] ++ acc) [] @@ -20,6 +23,12 @@ val compose : t1 ::: Type -> t2 ::: Type -> t3 ::: Type val txt : t ::: Type -> ctx ::: {Unit} -> use ::: {Type} -> show t -> t -> xml ctx use [] +val foldUR : tf :: Type -> tr :: ({Unit} -> Type) + -> (nm :: Name -> rest :: {Unit} + -> fn [[nm] ~ rest] => + tf -> tr rest -> tr ([nm] ++ rest)) + -> tr [] -> r :: {Unit} -> $(mapUT tf r) -> tr r + val foldTR : tf :: (Type -> Type) -> tr :: ({Type} -> Type) -> (nm :: Name -> t :: Type -> rest :: {Type} -> fn [[nm] ~ rest] => |