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

Safe HaskellNone

System.Chatty.Commands

Description

Provides in-haskell implementations for some standard functions

Synopsis

Documentation

cat :: (MonadScanner m, MonadPrinter m, MonadIO m, Functor m, MonadFinalizer m) => [String] -> m ()Source

Like cat on the command line. Accepts a list of filenames. Simple pass-through, if none are provided.

tac :: (MonadFinalizer m, MonadScanner m, MonadPrinter m, MonadIO m, Functor m) => [String] -> m ()Source

Like cat, but reverses the line order.

tee :: (MonadScanner m, MonadPrinter m, MonadIO m, Functor m) => String -> m ()Source

Pass-through, simultanously writing all input to a given file.

echo :: (MonadPrinter m, MonadExpand m) => String => m ()Source

Prints the given string, after expanding it.

data WcMode Source

Mode for wc.

wc :: (MonadScanner m, MonadPrinter m, MonadIO m, Functor m) => WcMode -> m ()Source

Count characters, lines or words of the input.

cd :: MonadIO m => String -> m ()Source

Change to given directory.

pwd :: (MonadIO m, MonadPrinter m) => m ()Source

Print current working directory.

ls :: (MonadIO m, MonadPrinter m) => [String] -> m ()Source

List directory contents of the given directories (current one, if empty list).

head :: (MonadScanner m, MonadPrinter m, MonadIO m, Functor m) => Int -> m ()Source

Filters only the first n lines of the input.

tail :: (MonadScanner m, MonadPrinter m, MonadIO m, Functor m) => Int -> m ()Source

FIlters only the last n lines of the input.