S.Option
Option signals
eq f
derives an equality function on options using f
for testing Some _
.
hold_value i s
is the last Some _
value of s
or i
if there was no such value:
hold_some i s
]t = i
if [s
]<t = None
hold_some i s
]t = v
if [s
]≤t = Some v
Uses s
's equality on Some _
.
val none : 'a option signal
none
is const None
.
some s
is map (fun v -> Some v) s
and uses s
's equality function to derive the obvious one on options.
value s ~default
is default
when s
is None
:
value s ~default
]t = v
if [s
]t = Some v
value s ~default
]t =
[default
]t if [s
]t = None
default
's equality function is used for the resulting signal.
val bind :
?eq:('b option -> 'b option -> bool) ->
'a option signal ->
('a -> 'b option) ->
'b option signal
bind ~eq s f
is map ~eq (fun v -> Option.bind v f) s
.
join ~eq oos
is map ~eq Option.join oos
.