eddie - run Haskell filters from the command line
eddie [ options ] [ EXPRESSION ] 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 --lines
, --files
and --names
options can be used to cause expression to be used to process each line, each file, or tuple of (name, content)
for each file, respectively. The --lists
option can be used with --lines
, --files
and --names
to cause the files to be processed as a list instead of one element at a time.
The ClassyPrelude
module is used instead of the default Prelude
when building expressions. The default type for input and output is Text
, but input or both can be changed to ByteString
with the --binary
and --text
options.
Other modules may be added with the --Module
and --module
options.
The --expression EXPRESSION (short form -e EXPRESSION ) 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 EXPRESSION option is present, the first non-flag argument will be used for the Haskell expression.
The --lines (short form -l) option causes eddie to process the input one line at a time. The EXPRESSION will be run on each line and the results concatenated together (using unlines).
The command
eddie -l EXPRESSION file ...
is equivalent to the command
eddie "unlines . map EXPRESSION . lines" file ...
Note that the --lines, --files and --names options cannot be used together.
The --files (short form -f) causes each file to be processed individually.
Note that the --lines, --files and --names options cannot be used together.
The --names (short form -n) causes each file to be processed individually, as a tuple of (name, content)
.
Note that the --lines, --files and --names 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 --list, --files or --names options be used.
The command
eddie -l -L EXPRESSION file ...
is equivalent to the command
eddie "EXPRESSION . lines" file ...
Text
to ByteString
. This disable all processing of the input and output.
The --lazy (no short form) option switches the data types to their lazy versions.
Note that using this is NOT recommended unless you know what you are doing. It seems to break type checking, cause hangs, or incorrect results when used. Even if everything works as expected, using it improperly can drastically increase memory usage and run time.
The --text (short form -t) option switches the output type back to Text
if the --binary or --lazy option was used.
Using --text without --binary or --lazy is an error.
The --input-encoding ENCODING (no short form) option sets the encoding of the input file(s) to ENCODING.
It is an error to use --input-encoding with --binary.
The --output-encoding ENCODING (no short form) option sets the encoding of the output file to ENCODING.
It is an error to use --output-encoding with --binary unless --text is also specified.
The --encoding ENCODING (no short form) option sets the encoding of all text files to ENCODING, whether for input or output.
It is an error to use --encoding with --binary unless --text is also specified.
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