Cslib.FreeM.WriterF
inductiveimported Lean
Type constructor for writer operations. Writer has a single effect, so the definition has just one constructor.
Statement
set_option autoImplicit true in set_option relaxedAutoImplicit true in universe u v w w' w'' in inductive Cslib.FreeM.WriterF (ω : Type u) : Type v → Type u /-- Write a value to the log. -/
- Defined in
- CSLib, `Cslib.FreeM.WriterF`
- Lean proof
- By Tanner Duve, 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.WriterF← Cslib.FreeM.WriterF (Cslib/Foundations/Control/Monad/Free/Effects.lean:166): verbatim
- Verified
- 08 Oct 2026
- Axioms
- none listed
- Used by 17
- Cslib.FreeM.FreeWriter.writerInterpInterpret
WriterFoperations intoWriterT. - Cslib.FreeM.FreeWriter.pass_defCslib.FreeM.FreeWriter.pass_def
- Cslib.FreeM.FreeWriter.runInterprets a
FreeWritercomputation by recursively traversing the tree, accumulating log entries with the monoid operation, and returns… - Cslib.FreeM.FreeWriter.tellWrites a log entry. This creates an effectful node in the computation tree.
- Cslib.FreeM.FreeWriter.tell_defCslib.FreeM.FreeWriter.tell_def
- Cslib.FreeM.FreeWriter.pass
passallows a subcomputation to modify its own log. After traversing the computation and accumulating its log, the resulting function is… - Cslib.FreeM.FreeWriter.run_lift_tellCslib.FreeM.FreeWriter.run_lift_tell
- Cslib.FreeM.FreeWriterWriter monad implemented via the
FreeMmonad construction. This provides a more efficient implementation than the traditionalWriterT… - Cslib.FreeM.FreeWriter.run_bindCslib.FreeM.FreeWriter.run_bind
- Cslib.FreeM.FreeWriter.listen_pureCslib.FreeM.FreeWriter.listen_pure
- Cslib.FreeM.FreeWriter.run_pureCslib.FreeM.FreeWriter.run_pure
- Cslib.FreeM.FreeWriter.listen
listencaptures the log produced by a subcomputation incrementally. It traverses the computation, emitting log entries as encountered,… - Cslib.FreeM.FreeWriter.instMonadWriterOfMonoidCslib.FreeM.FreeWriter.instMonadWriterOfMonoid
- Cslib.FreeM.FreeWriter.listen_lift_tell_bindCslib.FreeM.FreeWriter.listen_lift_tell_bind
- Cslib.FreeM.FreeWriter.toWriterTConvert a
FreeWritercomputation into aWriterTcomputation. This is the canonical interpreter derived fromliftM. - Cslib.FreeM.FreeWriter.run_toWriterTThe canonical interpreter
toWriterTderived fromliftMagrees with the hand-written recursive interpreterrunforFreeWriter. - Cslib.FreeM.FreeWriter.toWriterT_unique
toWriterTis the unique interpreter extendingwriterInterp.
- Cslib.FreeM.FreeWriter.writerInterpInterpret
Lean source view module on GitHub
set_option autoImplicit true in set_option relaxedAutoImplicit true in universe u v w w' w'' in /-- Type constructor for writer operations. Writer has a single effect, so the definition has just one constructor. -/ inductive Cslib.FreeM.WriterF (ω : Type u) : Type v → Type u /-- Write a value to the log. -/ | tell : ω → WriterF ω PUnit