One-line haskell program with GHC

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

One-line haskell program with GHC

Sukit Tretriluxana
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?

Thanks,
Ed

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: One-line haskell program with GHC

Clifford Beshers-3
2008/1/18 Sukit Tretriluxana <[hidden email]>:
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."'



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: One-line haskell program with GHC

Sukit Tretriluxana
Thanks a lot! I thought that option resided in ghci or runghc apps.

On Jan 18, 2008 2:00 PM, Clifford Beshers <[hidden email]> wrote:
2008/1/18 Sukit Tretriluxana <[hidden email]>:
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."'




_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: One-line haskell program with GHC

Gwern Branwen
In reply to this post by Sukit Tretriluxana
On 2008.01.18 13:57:27 -0800, Sukit Tretriluxana <[hidden email]> scribbled 1.3K characters:

>    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?
>
>    Thanks,
>    Ed
http://www.joachim-breitner.de/blog/archives/156-Haskell-on-the-Command-Line.html

http://haskell.org/haskellwiki/Simple_Unix_tools

http://www.haskell.org/pipermail/haskell-cafe/2007-March/023035.html

or

http://groups.google.com/group/fa.haskell/browse_thread/thread/e948ff0ad4d7c0c9/241dca1a802c68bb


--
gwern
hope Coderpunks sigvoice .45 sabana MI5 CISSP Digicash b Tyrell

_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe

attachment0 (196 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: One-line haskell program with GHC

Bugzilla from jonathanccast@fastmail.fm
In reply to this post by Clifford Beshers-3
On 18 Jan 2008, at 2:00 PM, Clifford Beshers wrote:

2008/1/18 Sukit Tretriluxana <[hidden email]>:
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



_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe
Reply | Threaded
Open this post in threaded view
|

Re: One-line haskell program with GHC

Sukit Tretriluxana
Thanks all. This really helps me a lot!

On Jan 18, 2008 6:24 PM, Jonathan Cast <[hidden email]> wrote:
On 18 Jan 2008, at 2:00 PM, Clifford Beshers wrote:

2008/1/18 Sukit Tretriluxana <[hidden email]>:
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




_______________________________________________
Haskell-Cafe mailing list
[hidden email]
http://www.haskell.org/mailman/listinfo/haskell-cafe