Input redirection in WinGHCi

I know I can do the following from a command prompt: $ runghc WC < quux.txt How do I do this in WinGHCi? I know I have to first load the file like this: Prelude> :load WC But then what? This doesn't work: *Main> WC < quux.txt <interactive>:1:1: Not in scope: data constructor `WC' <interactive>:1:6: Not in scope: `quux' <interactive>:1:11: Not in scope: `txt'

On 28 July 2011 04:56, Paul Reiners
I know I can do the following from a command prompt:
$ runghc WC < quux.txt
How do I do this in WinGHCi? I know I have to first load the file like this:
Prelude> :load WC
But then what? This doesn't work:
*Main> WC < quux.txt
<interactive>:1:1: Not in scope: data constructor `WC'
<interactive>:1:6: Not in scope: `quux'
<interactive>:1:11: Not in scope: `txt'
Probably something like: *Main> quux <- readFile "quux.txt" *Main> :main quux i.e. you can't do file redirection inside ghci -- Ivan Lazar Miljenovic Ivan.Miljenovic@gmail.com IvanMiljenovic.wordpress.com
participants (2)
-
Ivan Lazar Miljenovic
-
Paul Reiners