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

Safe HaskellTrustworthy



Provides a bunch of derived instances for the various typeclasses.



type IgnorantT m = QuietT (DeafT m) Source

IgnorantT ignores all output and does not provide any input.

type Ignorant = IgnorantT Identity Source

Ignorant is IgnorantT on the identity

type ChattyT m = HereStringT (RecorderT m) Source

ChattyT simulates a console, actually taking input as a string and recording output.

type Chatty = ChattyT Identity Source

Chatty is ChattyT on the identity

runIgnorantT :: Monad m => IgnorantT m a -> m a Source

Run IgnorantT (does not take anything)

runIgnorant :: Ignorant a -> a Source

Run Ignorant (does not take anything)

runChattyT :: (Monad m, Functor m) => ChattyT m a -> String -> m (a, String, Replayable) Source

Run ChattyT. Takes input as a string and returns (result, remaining input, output).

runChatty :: Chatty a -> String -> (a, String, Replayable) Source

Run Chatty. Takes input as a string and returns (result, remaining input, output).

(.|.) :: (Monad m, Functor m) => RecorderT m a -> HereStringT m b -> m b Source

Connect the output of some function to the input of another one. Compare with a pipe (cmd1 | cmd2).

(.<$.) :: (Functor m, Monad m) => (String -> m b) -> RecorderT m a -> m b Source

Runs the second function and feeds its output as an argument to the first one. Compare with process expansion ($(cmd)).