Darcs patch: let runghc.hs read from stdin if no file is provided

Don Stewart dons at galois.com
Wed Feb 6 11:07:59 EST 2008


simonmarhaskell:
> Don Stewart wrote:
> >This is a rather fun patch (imo) that lets runghc read from stdin (into
> >a temp file) if no filename is provided.
> >
> >It means this works,
> >    
> >    $ cat A.hs | runghc | python2.4| ruby | runghc | python2.4 | ruby
> >
> >Where A.hs is sigfpe's 3rd order quine,
> >
> >    http://sigfpe.blogspot.com/2008/02/third-order-quine-in-three-languages.html
> 
> Neat!  I'll commit this (or a variant of it - it's better to use bracket 
> than finally in this case).

Also note that I hardcoded /tmp. We should use TMPDIR or whatever portable
wrapper ghc normally uses.

-- Don



More information about the Cvs-ghc mailing list