From 20fe6fd5bb27486a7f3483ead05061e967c5a105 Mon Sep 17 00:00:00 2001 From: Adam Chlipala Date: Sat, 5 Dec 2009 14:01:34 -0500 Subject: Represent FFI function names as strings, to deal with cross-file recursion --- lib/ur/string.ur | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'lib/ur/string.ur') diff --git a/lib/ur/string.ur b/lib/ur/string.ur index fb5a3f97..41ec666d 100644 --- a/lib/ur/string.ur +++ b/lib/ur/string.ur @@ -26,3 +26,14 @@ fun msplit {Haystack = s, Needle = chs} = | Some i => Some (substring s {Start = 0, Len = i}, sub s i, substring s {Start = i + 1, Len = length s - i - 1}) + +fun all f s = + let + val len = length s + + fun al i = + i >= len + || (f (sub s i) && al (i + 1)) + in + al 0 + end -- cgit v1.2.3