chatty-0.5.4.0: Some monad transformers and typeclasses to simplify I/O on a transformer stack.

Safe HaskellNone

Text.Chatty.Interactor

Description

Provides a bunch of derived instances for the various typeclasses.

Synopsis

Documentation

type IgnorantT m = QuietT (DeafT m)Source

IgnorantT ignores all output and does not provide any input.

type Ignorant = IgnorantT IdentitySource

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 IdentitySource

Chatty is ChattyT on the identity

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

Run IgnorantT (does not take anything)

runIgnorant :: Ignorant a -> aSource

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 bSource

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 bSource

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