Control.Monad.Logger

purescript-0.15.15: PureScript Programming Language Compiler

Safe Haskell | None
Language | Haskell2010

Control.Monad.Logger

Description

A replacement for WriterT IO which uses mutable references.

Synopsis

- newtype Logger w a = Logger {
  - runLogger :: IORef w -> IO a
  }
- runLogger' :: Monoid w => Logger w a -> IO (a, w)

# Documentation

newtype Logger w a #

A replacement for WriterT IO which uses mutable references.

Constructors

Logger |
Fields runLogger :: IORef w -> IO a

#### Instances

Instances details

Monoid w => MonadBaseControl IO (Logger w) # |
Instance details Defined in Control.Monad.Logger Methods liftBaseWith :: (RunInBase (Logger w) IO -> IO a) -> Logger w a # restoreM :: StM (Logger w) a -> Logger w a #
Monoid w => MonadWriter w (Logger w) # |
Instance details Defined in Control.Monad.Logger Methods writer :: (a, w) -> Logger w a # tell :: w -> Logger w () # listen :: Logger w a -> Logger w (a, w) # pass :: Logger w (a, w -> w) -> Logger w a #
Monoid w => MonadBase IO (Logger w) # |
Instance details Defined in Control.Monad.Logger Methods liftBase :: IO α -> Logger w α #
Monoid w => MonadIO (Logger w) # |
Instance details Defined in Control.Monad.Logger Methods liftIO :: IO a -> Logger w a #
Monoid w => Applicative (Logger w) # |
Instance details Defined in Control.Monad.Logger Methods pure :: a -> Logger w a # (<*>) :: Logger w (a -> b) -> Logger w a -> Logger w b # liftA2 :: (a -> b -> c) -> Logger w a -> Logger w b -> Logger w c # (*>) :: Logger w a -> Logger w b -> Logger w b # (<*) :: Logger w a -> Logger w b -> Logger w a #
Functor (Logger w) # |
Instance details Defined in Control.Monad.Logger Methods fmap :: (a -> b) -> Logger w a -> Logger w b # (<$) :: a -> Logger w b -> Logger w a #
Monoid w => Monad (Logger w) # |
Instance details Defined in Control.Monad.Logger Methods (>>=) :: Logger w a -> (a -> Logger w b) -> Logger w b # (>>) :: Logger w a -> Logger w b -> Logger w b # return :: a -> Logger w a #
type StM (Logger w) a # |
Instance details Defined in Control.Monad.Logger type StM (Logger w) a = a

runLogger' :: Monoid w => Logger w a -> IO (a, w) #

Run a Logger computation, starting with an empty log.