monads-tf-0.1.0.1: Monad classes, using type families

Copyright(c) Andy Gill 2001, (c) Oregon Graduate Institute of Science and Technology, 2001
LicenseBSD-style (see the file LICENSE)
Maintainerross@soi.city.ac.uk
Stabilityexperimental
Portabilitynon-portable (type families)
Safe HaskellSafe-Inferred
LanguageHaskell98

Control.Monad.Writer.Class

Description

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.

Documentation

class (Monoid (WriterType m), Monad m) => MonadWriter m where

Associated Types

type WriterType m

Methods

tell :: WriterType m -> m ()

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

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

Instances

listens :: MonadWriter m => (WriterType m -> b) -> m a -> m (a, b)

censor :: MonadWriter m => (WriterType m -> WriterType m) -> m a -> m a