HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

Modulemonads-tf-0.3.0.1GHC2021

Control.Monad.Writer.Class

The MonadWriter class.

Inspired by the paper /Functional Programming with Overloading and Higher-Order Polymorphism/, Mark P Jones (http://web.cecs.pdx.edu/~mpj/pubs/springschool.html) Advanced School of Functional Programming, 1995.

Synopsis
classclass (Monoid (WriterType m), Monad m) => MonadWriter (m :: Type -> Type) where
#

Associated types

Methods

  • tell :: WriterType m -> m ()

    Shout to the monad what you want to be heard. The monad carries this packet upwards, merging it if needed (hence the Monoid requirement).

  • listen :: m a -> m (a, WriterType m)

    Listen to a monad acting, and return what the monad "said".

  • pass :: m (a, WriterType m -> WriterType m) -> m a

    Provide a writer transformer which changes internals of the written object.

Instances10MonadWriter, …