On 27 April 2010 05:43, Zura_ <[email protected]> wrote:
> Is it possible to run haskell program in emacs without typing "main" in the
> ghci buffer? Assuming "main" function exists of course.
> Or, maybe automate sending "main\n" string to ghci buffer input.
> In other words, I want edit/run/see result style session.

This is probably possible if you have enough elisp-fu (which I don't,
but have a look at Flymake Haskell).

If so, it would be better to have this as a different emacs keybinding
rather than the default haskell-load-file one, as 1) you won't always
have a main action and 2) you won't always want to _run_ your main
action (e.g. it launches nuclear missiles and you don't want to run
that when you're just testing your countdown function...).

However, by using ":main" in the ghci session you have a bit more
control as it allows you to specify command-line flags and inputs,
which running just "main" doesn't.

-- 
Ivan Lazar Miljenovic
[email protected]
IvanMiljenovic.wordpress.com
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to