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

Safe HaskellSafe
LanguageHaskell2010

System.Chatty.Commands

Description

Provides in-haskell implementations for some standard functions

Synopsis

Documentation

cat :: (ChScanner m, ChPrinter m, MonadIO m, Functor m, ChFinalizer m) => [String] -> m () Source

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

tac :: (ChFinalizer m, ChScanner m, ChPrinter m, MonadIO m, Functor m) => [String] -> m () Source

Like cat, but reverses the line order.

tee :: (ChScanner m, ChPrinter m, MonadIO m, Functor m) => String -> m () Source

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

echo :: (ChPrinter m, ChExpand m) => String -> m () Source

Prints the given string, after expanding it.

data WcMode Source

Mode for wc.

wc :: (ChScanner m, ChPrinter 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, ChPrinter m) => m () Source

Print current working directory.

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

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

head :: (ChScanner m, ChPrinter m, MonadIO m, Functor m) => Int -> m () Source

Filters only the first n lines of the input.

tail :: (ChScanner m, ChPrinter m, MonadIO m, Functor m) => Int -> m () Source

FIlters only the last n lines of the input.