
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? Thanks Tom Davie

Possibly HSH[1]?
[1] http://hackage.haskell.org/package/HSH-2.0.3
On Thu, Feb 10, 2011 at 8:44 AM, Thomas Davie
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?
Thanks
Tom Davie _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Thu, Feb 10, 2011 at 08:44, Thomas Davie
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?
Maybe you are thinking of this? http://www.joachim-breitner.de/blog/archives/156-Haskell-on-the-Command-Line...

Thomas Davie schrieb:
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?
It must be just 'ghc' not 'ghci' and yes, 'interact' must be called.
participants (4)
-
aditya siram
-
Henning Thielemann
-
Thedward Blevins
-
Thomas Davie