[Haskell-cafe] ghc -e with standard input

Graham Fawcett graham.fawcett at gmail.com
Mon Nov 5 14:41:45 EST 2007

On Nov 5, 2007 1:46 PM, Maurí­cio <briqueabraque at yahoo.com> wrote:
> Hi,
> Is there a way to run 'ghc -e' taking input
> from standard input? I would like to use it
> in a pipe.

It seems to me that you can use getContents, et. al., as you would
from any other Haskell program:

$ echo hello there mauricio | ghc -e "print =<< (Control.Monad.liftM
(reverse . words)) getContents"


More information about the Haskell-Cafe mailing list