Safe Haskell | Safe-Inferred |
---|
Provides a typeclass for all monads that may print text.
- class Monad m => MonadPrinter m where
- newtype DeafT m a = Deaf {
- runDeafT :: m a
- newtype OutRedirT m a = OutRedir {
- runOutRedirT' :: Handle -> m (a, Handle)
- type OutRedir = OutRedirT IO
- runOutRedirT :: Functor m => OutRedirT m a -> Handle -> m a
- 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' :: [String] -> m (a, [String])
- type Recorder = RecorderT Identity
- newtype Replayable = Replayable [String]
- replayM :: Monad m => m Replayable -> m String
- replay :: Replayable -> String
- replay_ :: Monad m => RecorderT m String
- runRecorder :: Recorder a -> (a, Replayable)
- runRecorderT :: (Functor m, Monad m) => RecorderT m a -> m (a, Replayable)
- mprintLn :: MonadPrinter m => String -> m ()
- mnomaskLn :: MonadPrinter m => String -> m ()
- data DiscardO = DiscardO
- data RecordO = RecordO
- class RedirectionTarget t mt a r | t -> mt, t a -> r where
- (.>.) :: (Functor m, MonadIO m, MonadPrinter (mt m)) => mt m a -> t -> m r
- (.>>.) :: (Functor m, MonadIO m, MonadPrinter (mt m)) => mt m a -> t -> m r
Documentation
class Monad m => MonadPrinter m whereSource
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).
MonadPrinter IO | |
MonadPrinter m0 => MonadPrinter (HandleCloserT m0) | |
MonadPrinter m0 => MonadPrinter (InRedirT m0) | |
MonadPrinter m0 => MonadPrinter (QuietT m0) | |
MonadPrinter m0 => MonadPrinter (HereStringT m0) | |
Monad m => MonadPrinter (RecorderT m) | |
MonadIO m => MonadPrinter (OutRedirT m) | |
Monad m => MonadPrinter (DeafT m) | |
MonadPrinter m0 => MonadPrinter (SpawnOverlayT m0) | |
MonadPrinter m => MonadPrinter (JoinerT m) | |
MonadPrinter m0 => MonadPrinter (NullExpanderT m0) | |
MonadPrinter m0 => MonadPrinter (ExpanderT m0) | |
MonadPrinter m0 => MonadPrinter (HistoryT m0) | |
MonadPrinter m => MonadPrinter (HtmlPrinterT m) | |
MonadPrinter m => MonadPrinter (AnsiPrinterT m) | |
Monad m => MonadPrinter (StateT String m) | |
(Eq c, MonadPrinter m) => MonadPrinter (FilterT c m) | |
(Eq c, Monad m) => MonadPrinter (ArchiverT c m) |
DeafT discards all output (much like >/dev/null in the shell)
MonadTrans DeafT | |
RedirectionTarget DiscardO DeafT a a | |
Monad m => Monad (DeafT m) | |
Functor m => Functor (DeafT m) | |
MonadIO m => MonadIO (DeafT m) | |
MonadRandom m0 => MonadRandom (DeafT m0) | |
MonadClock m0 => MonadClock (DeafT m0) | |
MonadFinalizer m0 => MonadFinalizer (DeafT m0) | |
MonadScanner m0 => MonadScanner (DeafT m0) | |
Monad m => MonadPrinter (DeafT m) | |
MonadSpawn m0 => MonadSpawn (DeafT m0) | |
MonadExpand m0 => MonadExpand (DeafT m0) | |
ExpanderEnv m0 => ExpanderEnv (DeafT m0) | |
HistoryEnv m0 => HistoryEnv (DeafT m0) |
Redirects all output to a given handle (much like >filename in the shell)
OutRedir | |
|
MonadTrans OutRedirT | |
RedirectionTarget FilePath OutRedirT a a | |
Monad m => Monad (OutRedirT m) | |
Monad m => Functor (OutRedirT m) | |
MonadIO m => MonadIO (OutRedirT m) | |
MonadRandom m0 => MonadRandom (OutRedirT m0) | |
MonadClock m0 => MonadClock (OutRedirT m0) | |
MonadFinalizer m0 => MonadFinalizer (OutRedirT m0) | |
MonadScanner m0 => MonadScanner (OutRedirT m0) | |
MonadIO m => MonadPrinter (OutRedirT m) | |
MonadSpawn m0 => MonadSpawn (OutRedirT m0) | |
MonadExpand m0 => MonadExpand (OutRedirT m0) | |
ExpanderEnv m0 => ExpanderEnv (OutRedirT m0) | |
HistoryEnv m0 => HistoryEnv (OutRedirT m0) |
Catches all output (much like VAR=$(...) in the shell)
Recorder | |
|
MonadTrans RecorderT | |
RedirectionTarget RecordO RecorderT a (a, Replayable) | |
Monad m => Monad (RecorderT m) | |
Monad m => Functor (RecorderT m) | |
MonadIO m => MonadIO (RecorderT m) | |
MonadRandom m0 => MonadRandom (RecorderT m0) | |
MonadClock m0 => MonadClock (RecorderT m0) | |
MonadFinalizer m0 => MonadFinalizer (RecorderT m0) | |
MonadScanner m0 => MonadScanner (RecorderT m0) | |
Monad m => MonadPrinter (RecorderT m) | |
MonadSpawn m0 => MonadSpawn (RecorderT m0) | |
MonadExpand m0 => MonadExpand (RecorderT m0) | |
ExpanderEnv m0 => ExpanderEnv (RecorderT m0) | |
HistoryEnv m0 => HistoryEnv (RecorderT m0) |
newtype Replayable Source
replay :: Replayable -> StringSource
Replay a recorder state in a pure context.
replay_ :: Monad m => RecorderT m StringSource
Replay the current recorder state without leaving the recorder.
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.
mprintLn :: MonadPrinter m => String -> m ()Source
Line-terminating alternative to mprint
mnomaskLn :: MonadPrinter m => String -> m ()Source
Line-terminating alternative to mnomask
Redirection target that discards input.
Redirection target that records input.
class RedirectionTarget t mt a r | t -> mt, t a -> r whereSource
Class for all redirection targets.
(.>.) :: (Functor m, MonadIO m, MonadPrinter (mt m)) => mt m a -> t -> m rSource
Overwriting redirection.
(.>>.) :: (Functor m, MonadIO m, MonadPrinter (mt m)) => mt m a -> t -> m rSource
Appending redirection.