1 (* Copyright (C
) 1999-2005 Henry Cejtin
, Matthew Fluet
, Suresh
2 * Jagannathan
, and Stephen Weeks
.
3 * Copyright (C
) 1997-2000 NEC Research Institute
.
5 * MLton is released under a BSD
-style license
.
6 * See the file MLton
-LICENSE for details
.
9 structure Option
: OPTION
=
12 datatype option
= datatype option
18 | SOME a
=> SOME (f a
)
20 fun app f z
= (ignore (map f z
); ())
22 fun compose (f
, g
) c
= map
f (g c
)
28 fun mapPartial f
= join
o (map f
)
30 fun composePartial (f
, g
) = (mapPartial f
) o g
32 fun filter f a
= if f a
then SOME a
else NONE
44 fn NONE
=> raise Option
49 structure OptionGlobal
: OPTION_GLOBAL
= Option