instance
Option.instDecidableMemOfDecidableEq
{α : Type u_1}
[DecidableEq α]
(j : α)
(o : Option α)
:
Equations
- Option.instDecidableMemOfDecidableEq j o = inferInstanceAs (Decidable (o = some j))
@[inline]
o = none
is decidable even if the wrapped type does not have decidable equality.
This is not an instance because it is not definitionally equal to instance : DecidableEq Option
.
Try to use o.isNone
or o.isSome
instead.
Equations
- Option.decidable_eq_none = decidable_of_decidable_of_iff ⋯
Instances For
instance
Option.instDecidableForallForallMemOfDecidablePred
{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
(o : Option α)
:
instance
Option.instDecidableExistsAndMemOfDecidablePred
{α : Type u_1}
{p : α → Prop}
[DecidablePred p]
(o : Option α)
:
@[inline]
Partial bind. If for some x : Option α
, f : Π (a : α), a ∈ x → Option β
is a
partial function defined on a : α
giving an Option β
, where some a = x
,
then pbind x f h
is essentially the same as bind x f
but is defined only when all x = some a
, using the proof to apply f
.
Instances For
@[inline]
def
Option.pmap
{α : Type u_1}
{β : Type u_2}
{p : α → Prop}
(f : (a : α) → p a → β)
(x : Option α)
:
Partial map. If f : Π a, p a → β
is a partial function defined on a : α
satisfying p
,
then pmap f x h
is essentially the same as map f x
but is defined only when all members of x
satisfy p
, using the proof to apply f
.
Equations
- Option.pmap f none x_2 = none
- Option.pmap f (some a) H = some (f a ⋯)