Equations
Equations
- (option.some x).get_or_else _x = x
- option.none.get_or_else e = e
Equations
Equations
Equations
- option.get h = x
- option.get h = false.rec α _
Equations
- (bool.tt|>a) = option.none
- (bool.ff|>a) = option.some a
Equations
- (_x<|option.some b) = b
- (a<|option.none) = a
@[protected]
Equations
- (option.some a).bind b = b a
- option.none.bind b = option.none
@[protected]
Equations
- option.map f o = o.bind (option.some ∘ f)
@[protected]
Equations
@[protected, instance]
Equations
- option.alternative = {to_applicative := {to_functor := {map := λ (_x _x_1 : Type u_1) (x : _x → _x_1) (y : option _x), has_pure.pure x <*> y, map_const := λ (α β : Type u_1), (λ (x : β → α) (y : option β), has_pure.pure x <*> y) ∘ function.const β}, to_has_pure := applicative.to_has_pure monad.to_applicative, to_has_seq := applicative.to_has_seq monad.to_applicative, to_has_seq_left := {seq_left := λ (α β : Type u_1) (a : option α) (b : option β), (λ (_x _x_1 : Type u_1) (x : _x → _x_1) (y : option _x), has_pure.pure x <*> y) α (β → α) (function.const β) a <*> b}, to_has_seq_right := {seq_right := λ (α β : Type u_1) (a : option α) (b : option β), (λ (_x _x_1 : Type u_1) (x : _x → _x_1) (y : option _x), has_pure.pure x <*> y) α (β → β) (function.const α id) a <*> b}}, to_has_orelse := {orelse := option.orelse}, failure := option.none}
@[protected, instance]
Equations
- option.inhabited α = {default := option.none α}
@[protected, instance]
Equations
- option.decidable_eq (option.some v₁) (option.some v₂) = option.decidable_eq._match_1 v₁ v₂ (d v₁ v₂)
- option.decidable_eq (option.some v₁) option.none = decidable.is_false _
- option.decidable_eq option.none (option.some v₂) = decidable.is_false _
- option.decidable_eq option.none option.none = decidable.is_true option.decidable_eq._main._proof_1
- option.decidable_eq._match_1 v₁ v₂ (decidable.is_true e) = decidable.is_true _
- option.decidable_eq._match_1 v₁ v₂ (decidable.is_false n) = decidable.is_false _