value default s
is s
with only its Some v
values. Whenever s
is None
, if default
is `Always dv
then the current value of dv
is used instead. If default
is `Init dv
the current value of dv
is only used if there's no value at creation time, otherwise the last Some v
value of s
is used.
- [
value ~default s
]t = v
if [s
]t = Some v
- [
value ~default:(`Always d) s
]t =
[d
]t if [s
]t = None
- [
value ~default:(`Init d) s
]0 =
[d
]0 if [s
]0 = None
- [
value ~default:(`Init d) s
]t =
[value ~default:(`Init d) s
]t' if [s
]t = None
and t' is the greatest t' < t with [s
]t' <> None
or 0 if there is no such t'
.