[Haskell-beginners] Emacs org-mode code block problem

Lawrence Bottorff borgauf at gmail.com
Mon May 27 17:49:59 UTC 2019


I've got this in an Emacs org-mode code block:

#+begin_src haskell :results output
doubleSmallNumber4 x =
  if x > 0
    then x
    else x * 2
#+end_src

but when I try to run it (with C-c C-c) I get

...
Prelude> doubleSmallNumber4 x =
  if x > 0
    then x
    else x * 2
"org-babel-haskell-eoe"

<interactive>:19:23: error:
    parse error (possibly incorrect indentation or mismatched brackets)
Prelude>
<interactive>:20:11: error:
    parse error (possibly incorrect indentation or mismatched brackets)
Prelude>
<interactive>:21:5-8: error: parse error on input ‘then’
Prelude>
<interactive>:22:5-8: error: parse error on input ‘else’
Prelude> "org-babel-haskell-eoe"
...

I can run

#+begin_src haskell
tripleMe x = x + x + x
#+end_src

just fine though -- which means I've done something right with my Emacs
init. The REPL started is 8.6.3 stack-ghci. I've formatted with the
org-mode C-c '

LB
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20190527/ff306504/attachment.html>


More information about the Beginners mailing list