[Haskell-cafe] Re: Reading files efficiently
Donald Bruce Stewart
dons at cse.unsw.edu.au
Mon Mar 20 16:44:30 EST 2006
> Donald Bruce Stewart wrote:
>
> >a) Compile your code with GHC instead of interpreting it. GHC is blazing fast.
>
> That's one answer I suppose! I quite liked using Hugs for that
> particular program because it's a script that I didn't want to spend
> time compiling. Oh well, it's not that important.
You can use 'ghci' as well -- it's much like hugs.
> I did notice that the script runs much quicker with runghc rather than
> runhugs. Is there any way of making runghc work with a script whose
> name doesn't end ".hs"?
Well, I know this works:
$ cat A.lhs
#!/usr/bin/env runhaskell
> main = putStrLn "gotcha!"
$ ./A.lhs
gotcha!
But for files with no .hs or .lhs extension? Anyone know of a trick?
-- Don
More information about the Haskell-Cafe
mailing list