Re: [Haskell-cafe] ghc -e with standard input

2007-11-05 Thread Rodrigo Queiro
interact :: (String -> String) -> IO () is a very handy function for ghc -e, e.g. ghc -e 'interact $ lines . map (show . (*2) . read) . unlines' will multiply the number on every line by 2. (interact takes a function which maps from entire input to entire output) On 05/11/2007, Graham Fawcett <[

Re: [Haskell-cafe] ghc -e with standard input

2007-11-05 Thread Brent Yorgey
On Nov 5, 2007 2:41 PM, Graham Fawcett <[EMAIL PROTECTED]> wrote: > On Nov 5, 2007 1:46 PM, Maurí­cio <[EMAIL PROTECTED]> 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 getContent

Re: [Haskell-cafe] ghc -e with standard input

2007-11-05 Thread Graham Fawcett
On Nov 5, 2007 1:46 PM, Maurí­cio <[EMAIL PROTECTED]> 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 mauri

Re: [Haskell-cafe] ghc -e with standard input

2007-11-05 Thread Brent Yorgey
On Nov 5, 2007 1:46 PM, Maurí­cio <[EMAIL PROTECTED]> wrote: > Hi, > > Is there a way to run 'ghc -e' taking input > from standard input? I would like to use it > in a pipe. > xargs ought to do the trick nicely. -Brent ___ Haskell-Cafe mailing list Has

[Haskell-cafe] ghc -e with standard input

2007-11-05 Thread Maurí­cio
Hi, Is there a way to run 'ghc -e' taking input from standard input? I would like to use it in a pipe. Thanks, Maurício ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe