[Haskell-cafe] One-line haskell program with GHC

Sukit Tretriluxana tretriluxana.s at gmail.com
Sun Jan 20 02:41:58 EST 2008


Thanks all. This really helps me a lot!

On Jan 18, 2008 6:24 PM, Jonathan Cast <jonathanccast at fastmail.fm> wrote:

> On 18 Jan 2008, at 2:00 PM, Clifford Beshers wrote:
>
> 2008/1/18 Sukit Tretriluxana <tretriluxana.s at gmail.com>:
>
> > Hi,
> >
> > I don't know if it's been asked before. I just wonder if GHC supports
> > some sort of one-liner program that can be specify right as the argument to
> > either ghci or runghc program. In perl, they have something like
> >
> > perl *-e* 'print "Hello"'
> >
> > Do we have similar thing with GHC?
>
>
>
>  ghc -e 'putStrLn "Yes, we do."'
>
>
> Although, unlike perl, you don't have to say print explicitly if you don't
> need it:
>
> ghc -e '"This works great!"'
>
> jcc
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080119/2c100f5e/attachment.htm


More information about the Haskell-Cafe mailing list