Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Provides a typeclass for all monads that may print text.
- class Monad m => ChPrinter m where
- newtype DeafT m a = Deaf {
- runDeafT :: m a
- newtype OutRedirT m a = OutRedir {
- runOutRedirT :: Handle -> m a
- type OutRedir = OutRedirT IO
- runOutRedir :: OutRedir a -> Handle -> IO a
- runOutRedirFT :: (Functor m, MonadIO m) => OutRedirT m a -> FilePath -> IOMode -> m a
- runOutRedirF :: OutRedir a -> FilePath -> IOMode -> IO a
- newtype RecorderT m a = Recorder {
- runRecorderT' :: m (a, [String])
- type Recorder = RecorderT Identity
- newtype Replayable = Replayable [String]
- replay :: Replayable -> String
- runRecorder :: Recorder a -> (a, Replayable)
- runRecorderT :: (Functor m, Monad m) => RecorderT m a -> m (a, Replayable)
- mprintLn :: ChPrinter m => String -> m ()
- mnomaskLn :: ChPrinter m => String -> m ()
- data DiscardO = DiscardO
- data RecordO = RecordO
- class RedirectionTarget t mt a r | t -> mt, t a -> r where
Documentation
class Monad m => ChPrinter m where Source
A typeclass for all monads that may output strings.
mprint :: String -> m () Source
Just print it!
mnoecho :: String -> m () Source
Print it, except you are IO.
Flush the buffer.
mnomask :: String -> m () Source
Alternative to mprint that does not mask any characters (depends on the carrier).
ChPrinter IO Source | |
Monad m => ChPrinter (RecorderT m) Source | |
MonadIO m => ChPrinter (OutRedirT m) Source | |
Monad m => ChPrinter (DeafT m) Source | |
ChPrinter m => ChPrinter (JoinerT m) Source | |
ChAtoms m => ChPrinter (FilePrinterT m) Source | |
ChPrinter m => ChPrinter (HtmlPrinterT m) Source | |
ChPrinter m => ChPrinter (AnsiPrinterT m) Source | |
(Eq c, ChPrinter m) => ChPrinter (FilterT c m) Source | |
(Eq c, Monad m) => ChPrinter (ArchiverT c m) Source |
DeafT discards all output (much like >/dev/null in the shell)
Redirects all output to a given handle (much like >filename in the shell)
OutRedir | |
|
MonadTrans OutRedirT Source | |
RedirectionTarget Handle OutRedirT a a Source | |
RedirectionTarget FilePath OutRedirT a a Source | |
Monad m => Monad (OutRedirT m) Source | |
Monad m => Functor (OutRedirT m) Source | |
Monad m => Applicative (OutRedirT m) Source | |
MonadIO m => MonadIO (OutRedirT m) Source | |
MonadIO m => ChPrinter (OutRedirT m) Source |
Catches all output (much like VAR=$(...) in the shell)
Recorder | |
|
newtype Replayable Source
The recorder state. Use this together with replay
, replayM
or replay_
.
replay :: Replayable -> String Source
Replay a recorder state in a pure context.
runRecorder :: Recorder a -> (a, Replayable) Source
Run Recorder
and also return its state.
runRecorderT :: (Functor m, Monad m) => RecorderT m a -> m (a, Replayable) Source
Run RecorderT
and also return its state.
Redirection target that discards input.
Redirection target that records input.
class RedirectionTarget t mt a r | t -> mt, t a -> r where Source
Class for all redirection targets.