emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Haskell code blocks


From: Thomas S. Dye
Subject: Re: Haskell code blocks
Date: Tue, 18 Oct 2022 17:50:30 -1000
User-agent: mu4e 1.6.10; emacs 27.1

Thanks Ihor. I don't actually use Haskell. Earlier this year I attempted to complete the Org Babel language documents on Worg, but couldn't get the obligatory "hello world" code block to behave in Haskell. I'm guessing that ob-haskell.el actually works for experienced Haskell programmers and was hoping someone had a solution to the Prelude> problem. I'm not sure when I might get back to this.

All the best,
Tom

Ihor Radchenko <yantar92@posteo.net> writes:

"Thomas S. Dye" <tsd@tsdye.online> writes:

I'm struggling to write a minimal ob-doc-haskell.org for Worg.

I installed Haskell via Spacemacs (development branch) and the Haskell installation appears to be functioning correctly.

The obligatory Hello World! example yields bad results.

#+name: haskell-hello-world
#+begin_src haskell main :: IO () main = putStrLn "Hello, World!"
main
#+end_src

#+RESULTS: haskell-hello-world
: Prelude> Hello, World!

I'm guessing the "Prelude>" part of the output is the prompt from the interpreter.

I found this in ob-haskell.el:

              (setq-local comint-prompt-regexp
(concat haskell-prompt-regexp "\\|^λ?> ")))) But I couldn't find a way to modify haskell-prompt-regexp without changing the source.

Advice welcome.

I guess you can report this as a bug in Haskell-mode?
haskell-prompt-regexp is defined there.

If absolutely necessary and if you want that _your_ Haskell prompt is different from Haskell-mode defaults, just setq haskell-prompt-regexp in
your config.


--
Thomas S. Dye
https://tsdye.online/tsdye



reply via email to

[Prev in Thread] Current Thread [Next in Thread]