chore: inline control primitives

This commit is contained in:
Henrik Böving 2022-10-15 13:04:55 +02:00 committed by Leonardo de Moura
parent 34e5ac3013
commit 741fac924a

View file

@ -233,14 +233,17 @@ class ForM (m : Type u → Type v) (γ : Type w₁) (α : outParam (Type w₂))
export ForM (forM)
/-- Left-to-right composition of Kleisli arrows. -/
@[alwaysInline]
def Bind.kleisliRight [Bind m] (f₁ : α → m β) (f₂ : β → m γ) (a : α) : m γ :=
f₁ a >>= f₂
/-- Right-to-left composition of Kleisli arrows. -/
@[alwaysInline]
def Bind.kleisliLeft [Bind m] (f₂ : β → m γ) (f₁ : α → m β) (a : α) : m γ :=
f₁ a >>= f₂
/-- Same as `Bind.bind` but with arguments swapped. -/
@[alwaysInline]
def Bind.bindLeft [Bind m] (f : α → m β) (ma : m α) : m β :=
ma >>= f