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
.
8 structure Option
: OPTION
=
15 fun fold (opt
, b
, f
) =
30 fun foreach (opt
, f
) =
40 | SOME x
=> SOME (f x
)
42 fun equals (o1
, o2
, eq
) =
45 |
(SOME x
, SOME y
) => eq (x
, y
)
53 fun toString xToString opt
=
56 | SOME x
=> concat
["Some ", xToString x
]
58 fun layout layoutX opt
=
64 | SOME x
=> seq
[str
"Some ", layoutX x
]