mathlib documentation

core / init.control.alternative

structure has_orelse (f : Type uType v) :
Type (max (u+1) v)
  • orelse : Π {α : Type ?}, f αf αf α
Instances of this typeclass
Instances of other typeclasses for has_orelse
  • has_orelse.has_sizeof_inst
def guard {f : Type → Type v} [alternative f] (p : Prop) [decidable p] :

If the condition p is decided to be false, then fail, otherwise, return unit.

Instances for guard
def assert {f : Type → Type v} [alternative f] (p : Prop) [decidable p] :
f (inhabited p)
def guardb {f : Type → Type v} [alternative f] :
boolf unit
def optional {f : Type uType v} [alternative f] {α : Type u} (x : f α) :
f (option α)
Instances for optional