diff options
author | Robin Green <greenrd@greenrd.org> | 2011-06-27 21:36:32 +0100 |
---|---|---|
committer | Robin Green <greenrd@greenrd.org> | 2011-06-27 21:36:32 +0100 |
commit | 5b1332cdbcfc6c08d73a45160990348de9e623b4 (patch) | |
tree | baaa835948c7145928d1263ae22b5021dd37eac8 /lib/ur/list.ur | |
parent | ff0dd4f2b85c772b725fe073a8d32ec7e2dff0d7 (diff) |
recToList
Diffstat (limited to 'lib/ur/list.ur')
-rw-r--r-- | lib/ur/list.ur | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ur/list.ur b/lib/ur/list.ur index d0c2e7a1..32a9679c 100644 --- a/lib/ur/list.ur +++ b/lib/ur/list.ur @@ -353,3 +353,7 @@ fun assocAdd [a] [b] (_ : eq a) (x : a) (y : b) (ls : t (a * b)) = case assoc x ls of None => (x, y) :: ls | Some _ => ls + +fun recToList [a ::: Type] [r ::: {Unit}] (fl : folder r) + = @foldUR [a] [fn _ => list a] (fn [nm ::_] [rest ::_] [[nm] ~ rest] x xs => + x :: xs) [] fl |