diff lib/ur/list.ur @ 1481:3061d1bf4b2d

recToList
author Robin Green <greenrd@greenrd.org>
date Mon, 27 Jun 2011 21:36:32 +0100
parents d328983dc5a6
children ada582d07ae1
line wrap: on
line diff
--- a/lib/ur/list.ur	Tue Jun 28 11:55:57 2011 +0100
+++ b/lib/ur/list.ur	Mon Jun 27 21:36:32 2011 +0100
@@ -353,3 +353,7 @@
     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