monad-unlift-0.1.0.0: Typeclasses for representing monad transformer unlifting

Safe HaskellNone
LanguageHaskell2010

Control.Monad.Trans.Writer.Ref

Description

An implementation of WriterT built on top of mutable references, providing a proper monad morphism.

An additional advantage of this transformer over the standard WriterT transformers in the transformers package is that it does not have space leaks. For more information, see https://mail.haskell.org/pipermail/libraries/2012-October/018599.html.

Synopsis

Documentation

data WriterRefT ref w m a Source

Since 0.1.0

Instances

MonadBase b m => MonadBase b (WriterRefT ref w m) 
MonadBaseControl b m => MonadBaseControl b (WriterRefT ref w m) 
((~) * (MCState (ref w)) (PrimState b), Monad m, (~) * w (RefElement (ref w)), MutableRef (ref w), PrimMonad b, MonadBase b m, Monoid w) => MonadWriter w (WriterRefT ref w m) 
MonadTrans (WriterRefT ref w) 
MonadTransControl (WriterRefT ref w) 
Monad m => Monad (WriterRefT ref w m) 
Functor m => Functor (WriterRefT ref w m) 
Applicative m => Applicative (WriterRefT ref w m) 
MonadIO m => MonadIO (WriterRefT ref w m) 
MonadThrow m => MonadThrow (WriterRefT ref w m) 
MonadMask m => MonadMask (WriterRefT ref w m) 
MonadCatch m => MonadCatch (WriterRefT ref w m) 
type StT (WriterRefT ref w) a = a 
type StM (WriterRefT ref w m) a = StM m a 

runWriterRefT :: (Monad m, w ~ RefElement (ref w), MCState (ref w) ~ PrimState b, MonadBase b m, MutableRef (ref w), PrimMonad b, Monoid w) => WriterRefT ref w m a -> m (a, w) Source

Since 0.1.0

runWriterIORefT :: (Monad m, RealWorld ~ PrimState b, MonadBase b m, PrimMonad b, Monoid w) => WriterRefT IORef w m a -> m (a, w) Source

Since 0.1.0

runWriterSTRefT :: (Monad m, ps ~ PrimState b, MonadBase b m, PrimMonad b, Monoid w) => WriterRefT (STRef ps) w m a -> m (a, w) Source

Since 0.1.0