diff options
author | Adam Chlipala <adamc@hcoop.net> | 2009-09-08 10:18:19 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2009-09-08 10:18:19 -0400 |
commit | d07c91bf275874a5f6f13af5f338def78eea7ae0 (patch) | |
tree | 700a022259cb238d022c76cb0b6c30fb44985aed /lib/ur/list.ur | |
parent | 815c52605cdba3c95d7e4e6fd3f1eddf0939bc6a (diff) |
dragList almost kinda works
Diffstat (limited to 'lib/ur/list.ur')
-rw-r--r-- | lib/ur/list.ur | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/ur/list.ur b/lib/ur/list.ur index 3d4134ea..9e2550ca 100644 --- a/lib/ur/list.ur +++ b/lib/ur/list.ur @@ -44,6 +44,16 @@ fun foldlAbort [a] [b] f = 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) = |