[Haskell-cafe] ANNOUNCE: bash script for haskell

James Crayne jim.crayne at gmail.com
Fri Feb 6 00:35:44 UTC 2015


Note the hk script gives you a richer default environment, including
System.Environment and a bunch of other commonly used modules.

Also, some magic to sort of detect what you want, in the case of whether
you give it a pure function vs an IO etc. For one offs on the command line,
a slightly less picky type check seems to make sense in my opinion. In the
case that it doesn't work, it lets you edit the script in a text editor,
there by showing you what the real haskell looks like.

Not that I am especially proud, the implementation could be cleaned up a
lot I am sure, but the user interface is failry nice I think.

One caveat I probably should mention in the README but didn't, is that your
script is copied to a file stored under /tmp, so you don't want to put
passwords or anything of that matter in it.



On Thu, Feb 5, 2015 at 6:46 PM, Tom Ellis <
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:

> On Fri, Feb 06, 2015 at 12:42:14AM +0100, Peter Simons wrote:
> > This announcement left me totally amazed at the realization that neither
> > "runhaskell" nor "ghci" seem to have a command-line option equivalent to
> > "-c" in Bourne shell.
> >
> > Am I missing something terribly obvious?
>
> How about
>
>   ghc -e 'do { putStrLn "What is your name?"; name <- getLine; putStrLn $
> "Hello " ++ name }'
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20150205/b221ac73/attachment.html>


More information about the Haskell-Cafe mailing list