Monad Morphisms Commute with Loops #
The bundled corollaries, for MonadHom, of cslib's IsMonadHom.map_list* lemmas and of
ToCslib.Control.Monad.HomTransport: a monad morphism between lawful monads commutes with
forIn', forIn, forM, foldlM, and mapM over lists, and with forIn over any container
whose loop is the loop over ForIn.toList. Each is an equation whose left-hand side is the
morphism applied to the loop, so simp pushes morphisms into loop bodies the way mmap_bind
pushes them into binds, and grind can index the list forms. Lawfulness is what lets the bundled
arrow — which carries only its pure and bind laws — satisfy cslib's predicate
(MonadHom.isMonadHom).
Not a simp lemma: simp already derives it from mmap_forIn' through core's
List.forIn'_eq_forIn.
Stated with the class method forM, the simp normal form of List.forM.