[Haskell-cafe] ghci command line execution
aditya.siram at gmail.com
Thu Feb 10 15:49:29 CET 2011
On Thu, Feb 10, 2011 at 8:44 AM, Thomas Davie <tom.davie at gmail.com> wrote:
> A while ago I remember someone showing me some tool, I *think* ghci that allowed you to pass it a function of type String -> String as an input, and have it simply run that function on stdin (presumably using interact) to achieve useful things like this...
> $ cat myFile.txt | ghci -e 'unlines . zipWith (\x y -> show x ++ " " ++ y) [1..] . lines'
> Does anyone know what it was that I saw being used here?
> Tom Davie
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe