Pandoc itself does not know how to execute Haskell code, but you can write your own program that combines Pandoc with a Haskell interpreter (say from the hint package).
I think Brent Yorgey did something like that a couple of years ago:
Running programs is considered out of scope for pandoc and most likely won’t be added, at least not to “core” pandoc. It would be great, of course, if somebody takes the time to write a filter to do this. I set out to do that a few years back, but it proved to be too much work. And, as you note, jupyter, ihaskell, and Emacs Org mode already exist.
Running programs is considered out of scope for pandoc and most likely won’t be
added, at least not to “core” pandoc. It would be great, of course, if somebody
takes the time to write a filter to do this.
I’ve not followed this whole thread, but if you want a pandoc filter to
run the content of code blocks then you might try “panpipe”:
https://hackage.haskell.org/package/panpipe
It pipes the content of code blocks through arbitrary shell commands,
e.g.
```{pipe="runhaskell | tr l L"}
main = putStrLn "hello world"
```
will become:
```
heLLo worLd
```
It uses pandoc JSON, so any pandoc-supported format will work (markdown,
HTML, etc.). Another filter called “panhandle” can extract pandoc JSON
from a code block and splice it into the document:
https://hackage.haskell.org/package/panhandle
This way we can use panpipe to procedurally generate content, then use
panhandle to splice it into the document.
I’ve been using these to generate my web site for years. I’ve documented
them with a bunch of examples here:
http://chriswarbo.net/projects/activecode
Note that these both currently depend on pandoc 1.17.*, since pandoc’s
JSON format changed after that version. If that’s a problem for someone
then I don’t mind updating these filters; they’ve just been feature
complete for so long that I’ve not had a reason to make any changes.
Not sure if this is any help but my knit-haskell library does this in the opposite direction, that is, it allows you to embed pandoc blocks in a haskell program.
But, I think, it may serve the same purpose, of allowing you to execute haskell code and put the results into a pandoc-created html document.