Cslib.FreeM.bind
defimported Lean
Bind operation for the FreeM monad. The builtin >>= notation should be preferred when α and β are in the same universe.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in universe u v w w' w'' in variable {F : Type u → Type v} {ι : Type u} {α : Type w} {β : Type w'} {γ : Type w''} in protected def Cslib.FreeM.bind (x : FreeM F α) (f : α → FreeM F β) : FreeM F β
- Defined in
- CSLib, `Cslib.FreeM.bind`
- Lean proof
- By Tanner Duve, Eric Wieser, from github.com/leanprover/cslib at
3951377e5a3f(Copyright (c) 2025 Tanner Duve. All rights reserved, Apache-2.0). Compiled here against leanprover/lean4:v4.33.1, Mathlib v4.33.1; written for leanprover/lean4:v4.33.0.Cslib.FreeM.bind← Cslib.FreeM.bind (Cslib/Foundations/Control/Monad/Free.lean:110): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Built on 2
- Cslib.FreeM.instPureCslib.FreeM.instPure
- Cslib.FreeMThe Free monad over a type constructor
F. AFreeM F ais a tree of operations from the type constructorF, with leaves of typea.…
- Used by 21
- Cslib.FreeM.FreeCont.run_bindCslib.FreeM.FreeCont.run_bind
- Cslib.FreeM.liftM_bindCslib.FreeM.liftM_bind
- Cslib.FreeM.liftBind_eqCslib.FreeM.liftBind_eq
- Cslib.FreeM.comp_mapCslib.FreeM.comp_map
- Cslib.FreeM.bind_pureCslib.FreeM.bind_pure
- Cslib.FreeM.bind_eq_bindNote that this lemma does not always apply, as it is universe-constrained by
Bind.bind. - Cslib.FreeM.instBindCslib.FreeM.instBind
- Cslib.FreeM.foldFreeM_lift_bindCslib.FreeM.foldFreeM_lift_bind
- Cslib.FreeM.Interprets.eqCslib.FreeM.Interprets.eq
- Cslib.FreeM.FreeWriter.run_bindCslib.FreeM.FreeWriter.run_bind
- Cslib.FreeM.pure_bind
.pure afollowed bybindcollapses immediately. - Cslib.FreeM.map_bindCslib.FreeM.map_bind
- Cslib.FreeM.inductionAn override for the default induction principle that is in simp-normal form. Note that when
αandιare in the same universe, this… - Cslib.FreeM.FreeState.run_bindCslib.FreeM.FreeState.run_bind
- Cslib.FreeM.FreeCont.run_toContTThe canonical interpreter
toContTderived fromliftMagrees with the hand-written recursive interpreterrunforFreeCont. - Cslib.FreeM.id_mapCslib.FreeM.id_map
- Cslib.FreeM.bind_assocCslib.FreeM.bind_assoc
- Cslib.FreeM.foldFreeM_uniqueUniversal Property: If
h : FreeM F α → βsatisfies: *h (pure a) = onValue a*… - Cslib.FreeM.bind_pure_compCslib.FreeM.bind_pure_comp
- Cslib.FreeM.FreeWriter.run_toWriterTThe canonical interpreter
toWriterTderived fromliftMagrees with the hand-written recursive interpreterrunforFreeWriter. - Cslib.FreeM.FreeState.run'_bindCslib.FreeM.FreeState.run'_bind
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in universe u v w w' w'' in variable {F : Type u → Type v} {ι : Type u} {α : Type w} {β : Type w'} {γ : Type w''} in /-- Bind operation for the `FreeM` monad. The builtin `>>=` notation should be preferred when `α` and `β` are in the same universe. -/ protected def Cslib.FreeM.bind (x : FreeM F α) (f : α → FreeM F β) : FreeM F β := match x with | .pure a => f a | .liftBind op cont => .liftBind op fun z => FreeM.bind (cont z) f