chatty-0.7.0.0: Some monad transformers and typeclasses for abstraction of global dependencies.

Safe HaskellSafe
LanguageHaskell2010

Text.Chatty.Channel.Printer

Description

Provides a printer class that offers several channels.

Synopsis

Documentation

class (ChPrinter m, Eq c) => ChChannelPrinter c m where Source

Typeclass for all printers that offer several channels.

Minimal complete definition

cstart, cfin, cthis

Methods

cbracket :: c -> m a -> m a Source

Run the function with the given channel.

cstart :: c -> m () Source

Switch to the given channel

cfin :: c -> m () Source

Return to the previous channel. The argument is bogus (just for type inference).

cprint :: c -> String -> m () Source

Print the string to the given channel.

cthis :: m c Source

Return the current channel.

Instances

newtype ArchiverT c m a Source

Catches all output on multiple channels.

Constructors

Archiver 

Fields

runArchiverT' :: ([(c, [String])], [c]) -> m (a, ([(c, [String])], [c]))
 

runArchiverT :: (Eq c, Monad m) => c -> ArchiverT c m a -> m (a, [(c, Replayable)]) Source

newtype FilterT c m a Source

Forwards output only on a specific channel.

Constructors

Filter 

Fields

runFilterT :: (c, [c]) -> m (a, [c])
 

newtype JoinerT m a Source

Joins all output regardless of its channel.

Constructors

Joiner 

Fields

runJoinerT :: m a