eddie - run haskell filters from the command line
eddie [ options ] [ expr ] file ...
eddie evalutes the provided expression on either the contents of the file arguments concatenated together, or standard input if no *file arguments are present.
The --line, --file and --list options can be used to cause expression to be used to process each line, each file, or a list of files or lines respectively.
The prelude, Data.List
and Data.Char
modules are available for building expressions. Other modules may be added with the --Modules and --modules options.
The --expr expr (short form -e expr ) option concatenates it's value to the haskell expression being evaluated with a newline separator. Multiple occurrences can be used to build up a multi-line expression.
If no -e expr option is present, the first non-flag argument will be used for the haskell expression.
The --line (short form -l) option causes eddie to process input line at a time. The expr will be run on each line and the results concatenated together (using unlines).
The command
eddie -l *expr file* ...
is equivalent to the command
eddie "unlines . map *expr* . lines" *file* ...
The --file (short form -f) causes each file to be processed individually.
Note that the -l and -f options cannot be used together.
The --list (short form -L) option causes eddie to pass the expression a list of lines or files. This requires one of the -l or -f options be used.
The command
eddie -lL *expr file* ...
is equivalent to the command
eddie "unlines . *expr* . lines" filei ...
If the command runs with no problems, eddie will exit with a status of 0. If there are problems with the options, such that the expression is never evaluated, then eddie will exit with a status of 1. If haskell returns an error - probably a compilation problem - then eddie will exit with the status of 2.
The wiki at https://chiselapp.com/user/mwm/repository/eddie/wcontent for examples.
See the issues list at https://chiselapp.com/user/mwm/repository/eddie/rptview?rn=1.
Mike Meyer