(Heads up: mostly just playing with ideas and types; no real use cases in sight. Also, I apologize upfront for the silly examples.)
You can use markdown-unlit to load this file as a Literate Haskell file. If you don't want to install it globally on your system, something like this should work: