tell-0.1: The MonadTell class and related monad transformers.
Copyright(C) 2021 Isaac Elliott
LicenseBSD-3 (see the file LICENSE)
MaintainerIsaac Elliott <isaace71295@gmail.com>
Safe HaskellNone
LanguageHaskell2010

Control.Monad.Trans.HandleWriter

Description

 
Synopsis

Documentation

newtype HandleWriterT w m a Source #

A monad that can write a monoidal summary to a Handle.

Constructors

HandleWriterT 

Fields

Instances

Instances details
MonadState s m => MonadState s (HandleWriterT w m) Source # 
Instance details

Defined in Control.Monad.Trans.HandleWriter

Methods

get :: HandleWriterT w m s #

put :: s -> HandleWriterT w m () #

state :: (s -> (a, s)) -> HandleWriterT w m a #

MonadReader r m => MonadReader r (HandleWriterT w m) Source # 
Instance details

Defined in Control.Monad.Trans.HandleWriter

Methods

ask :: HandleWriterT w m r #

local :: (r -> r) -> HandleWriterT w m a -> HandleWriterT w m a #

reader :: (r -> a) -> HandleWriterT w m a #

MonadError e m => MonadError e (HandleWriterT w m) Source # 
Instance details

Defined in Control.Monad.Trans.HandleWriter

Methods

throwError :: e -> HandleWriterT w m a #

catchError :: HandleWriterT w m a -> (e -> HandleWriterT w m a) -> HandleWriterT w m a #

(Monoid w, MonadIO m) => MonadTell w (HandleWriterT w m) Source #

The MonadTell law tell (a <> b) ≡ tell a *> tell b is only obeyed when the Handle is written to by a single thread.

Instance details

Defined in Control.Monad.Trans.HandleWriter

Methods

tell :: w -> HandleWriterT w m () Source #

MonadTrans (HandleWriterT w) Source # 
Instance details

Defined in Control.Monad.Trans.HandleWriter

Methods

lift :: Monad m => m a -> HandleWriterT w m a #

Monad m => Monad (HandleWriterT w m) Source # 
Instance details

Defined in Control.Monad.Trans.HandleWriter

Methods

(>>=) :: HandleWriterT w m a -> (a -> HandleWriterT w m b) -> HandleWriterT w m b #

(>>) :: HandleWriterT w m a -> HandleWriterT w m b -> HandleWriterT w m b #

return :: a -> HandleWriterT w m a #

Functor m => Functor (HandleWriterT w m) Source # 
Instance details

Defined in Control.Monad.Trans.HandleWriter

Methods

fmap :: (a -> b) -> HandleWriterT w m a -> HandleWriterT w m b #

(<$) :: a -> HandleWriterT w m b -> HandleWriterT w m a #

Applicative m => Applicative (HandleWriterT w m) Source # 
Instance details

Defined in Control.Monad.Trans.HandleWriter

Methods

pure :: a -> HandleWriterT w m a #

(<*>) :: HandleWriterT w m (a -> b) -> HandleWriterT w m a -> HandleWriterT w m b #

liftA2 :: (a -> b -> c) -> HandleWriterT w m a -> HandleWriterT w m b -> HandleWriterT w m c #

(*>) :: HandleWriterT w m a -> HandleWriterT w m b -> HandleWriterT w m b #

(<*) :: HandleWriterT w m a -> HandleWriterT w m b -> HandleWriterT w m a #

MonadIO m => MonadIO (HandleWriterT w m) Source # 
Instance details

Defined in Control.Monad.Trans.HandleWriter

Methods

liftIO :: IO a -> HandleWriterT w m a #

MonadCont m => MonadCont (HandleWriterT w m) Source # 
Instance details

Defined in Control.Monad.Trans.HandleWriter

Methods

callCC :: ((a -> HandleWriterT w m b) -> HandleWriterT w m a) -> HandleWriterT w m a #

runHandleWriterT Source #

Arguments

:: Handle

Target file handle

-> (Handle -> w -> IO ())

The function that will write to the file handle

-> HandleWriterT w m a 
-> m a 

data Env w Source #

Constructors

Env !Handle !(Handle -> w -> IO ())