The areas / V33. Data structures and computation
Mathlib.Control.Monad.Basic
4 declarations. Mathlib docs · Source
theorem map_eq_bind_pure_comp E0 #
∀ {α β : Type u} (m : Type u → Type v) [inst : Monad m] [LawfulMonad m] (f : α → β) (x : m α), f <$> x = x >>= pure ∘ f
def StateT.eval E1 #
{α σ : Type u} → {m : Type u → Type v} → [Functor m] → StateT σ m α → σ → m α
run a StateT program and discard the final state
def StateT.equiv E1 #
{σ₁ α₁ : Type u₀} →
{σ₂ α₂ : Type u₁} →
{m₁ : Type u₀ → Type v₀} →
{m₂ : Type u₁ → Type v₁} → (σ₁ → m₁ (α₁ × σ₁)) ≃ (σ₂ → m₂ (α₂ × σ₂)) → StateT σ₁ m₁ α₁ ≃ StateT σ₂ m₂ α₂
reduce the equivalence between two state monads to the equivalence between their respective function spaces
def ReaderT.equiv E1 #
{ρ₁ α₁ : Type u₀} →
{ρ₂ α₂ : Type u₁} →
{m₁ : Type u₀ → Type v₀} →
{m₂ : Type u₁ → Type v₁} → (ρ₁ → m₁ α₁) ≃ (ρ₂ → m₂ α₂) → ReaderT ρ₁ m₁ α₁ ≃ ReaderT ρ₂ m₂ α₂
reduce the equivalence between two reader monads to the equivalence between their respective function spaces