1 (* Copyright (C
) 1999-2006 Henry Cejtin
, Matthew Fluet
, Suresh
2 * Jagannathan
, and Stephen Weeks
.
4 * MLton is released under a BSD
-style license
.
5 * See the file MLton
-LICENSE for details
.
10 val a
= Array
.array(numChars
, false)
14 else (Array
.update(a
, ord(String.sub(s
, i
)), true)
17 ; fn c
=> Array
.sub(a
, ord c
)
20 fun notContains s
= not
o (contains s
)
22 fun memoize (f
: char
-> 'a
): char
-> 'a
=
23 let val a
= Array
.tabulate(numChars
, f
o chr
)
24 in fn c
=> Array
.sub(a
, ord c
)
28 val not
= fn f
=> memoize(not
o f
)
30 fun f or g
= memoize(fn c
=> f c
orelse g c
)
31 fun f andd g
= memoize(fn c
=> f c
andalso g c
)