Import Upstream version 20180207
[hcoop/debian/mlton.git] / lib / mlton / basic / option.sig
1 (* Copyright (C) 1999-2005 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 *
4 * MLton is released under a BSD-style license.
5 * See the file MLton-LICENSE for details.
6 *)
7
8 signature OPTION =
9 sig
10 type 'a t = 'a option
11
12 val app: 'a t * ('a -> unit) -> unit
13 val equals: 'a t * 'a t * ('a * 'a -> bool) -> bool
14 val exists: 'a t * ('a -> bool) -> bool
15 val fold: 'a t * 'b * ('a * 'b -> 'b) -> 'b
16 val forall: 'a t * ('a -> bool) -> bool
17 val foreach: 'a t * ('a -> unit) -> unit
18 val isNone: 'a t -> bool
19 val isSome: 'a t -> bool
20 val layout: ('a -> Layout.t) -> 'a t -> Layout.t
21 val map: 'a t * ('a -> 'b) -> 'b t
22 val toString: ('a -> string) -> 'a t -> string
23 val valOf: 'a t -> 'a
24 end