eddie-1.0.0: eddie.md
% eddie(1)
# NAME
eddie \- run Haskell filters from the command line
# SYNOPSYS
**eddie** [ *options* ] [ *EXPRESSION* ] *FILE* ...
# DESCRIPTION
**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.
# OPTIONS
**--expression**
: 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.
**--lines**
: 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.
**--files**
: The **--files** (short form **-f**) causes each file to be processed
individually.
Note that the **--lines**, **--files** and **--names** options
cannot be used together.
**--names**
: 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.
**--list**
: 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 ...
```
**--binary**
: The **--binary** (short form **-b**) option changes the data from
`Text` to `ByteString`. This disable all processing of the input
and output.
**--lazy**
: 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.
**--text**
: 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.
**--input-encoding**
: 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**.
**--output-encoding**
: 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.
**--encoding**
: 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.
**--module**
: The **--module** *NAME* (short form **-m** *NAME*) option is used
to import module *NAME* into Haskell before evaluating the
expression.
**--Module**
: The **--Module** *NAME*,*AS* (short form **-M** *NAME*,*AS*) option
imports the *NAME* module using a qualified import with an as
clause, with *AS* being the value for the as clause.
**--extension**
: The **--extension** *EXTENSION* (short form **-X** *EXTENSION*)
option is used to enable the named GHC extension when evaluating
the expression.
# DIAGNOSTICS
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.
# SEE ALSO
The wiki at <https://chiselapp.com/user/mwm/repository/eddie/wcontent>
for examples.
# BUGS
See the issues list at <https://chiselapp.com/user/mwm/repository/eddie/rptview?rn=1>.
# AUTHOR
Mike Meyer <mwm@mired.org>