I recently wimped out of trying to update ob-haskell as an official maintainer, but I'd eventually like to get back to it -- after I get some base understanding of what Haskell is (Zeno's paradox-land?) and how the ghci works. Basically, the ghci is what it is -- tautological, but true. And that means when ob-haskell does nothing but dump the contents of a babel code block into ghci, it's no better than if the user had typed in into the REPL line-by-line. A quick run-down:
:set +m supposedly alerts ghci that a multi-line expression is coming, will come; but typically, it doesn't infer this very well.
Enclosing code in :{ ... :} is fairly good -- again you can type this in at the REPL prompt and see how it works -- however, there are gotchas.
a plain block:
#+begin_src haskell
...code...
#+end_src
is okay when you only have a one-liner to evaluate. But again, ob-haskell seems to do nothing but take the block contents and dump it to the ghci REPL as though the user had typed it in line-by-line, Enter, Enter...
What would be nice is if a C-c C-c inside a block could somehow act as though the ghci were being sent a regular *.hs buffer in haskell-mode -- and that, of course, cumulatively. C-' creates a decent haskell-mode environment, BTW, so some form of a babel block to haskell-mode connection does exist....
So am I on the right track? It's obvious at this point raw dumps into the REPL aren't optimal, i.e., are fraught. What is, e.g., geiser&Scheme doing that ob-haskell isn't?
LB
PS: Eventually, I'll try to glean some hints from the
Jupyter Haskell effort.
PPS:
GHCI User's Guide doesn't really tell me anything other than yes, ob-haskell is raw-dumping into an environment that isn't designed to play nice with babel.