Mercurial > urweb
diff lib/ur/list.ur @ 916:b873feb3eb52
dragList almost kinda works
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 08 Sep 2009 10:18:19 -0400 |
parents | ed06e25c70ef |
children | 166ea3944b91 |
line wrap: on
line diff
--- a/lib/ur/list.ur Tue Sep 08 07:48:57 2009 -0400 +++ b/lib/ur/list.ur Tue Sep 08 10:18:19 2009 -0400 @@ -44,6 +44,16 @@ foldlAbort' end +val length = fn [a] => + let + fun length' acc (ls : list a) = + case ls of + [] => acc + | _ :: ls => length' (acc + 1) ls + in + length' 0 + end + val rev = fn [a] => let fun rev' acc (ls : list a) =