From d07c91bf275874a5f6f13af5f338def78eea7ae0 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Tue, 8 Sep 2009 10:18:19 -0400 Subject: dragList almost kinda works --- lib/ur/list.ur | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'lib/ur/list.ur') 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) = -- cgit v1.2.3