Earlier quoted context omitted.
https://github.com/rust-lang/rust/issues/26097
With the literate style, code is prefixed and comments are raw. So, instead of: -- foo is a function foo :: String -> String It's foo is a function > foo :: String -> String
My tool of choice for this is Emacs org-mode with noweb support. The source file is "tangled" (i.e. individual chunks of code are glued back together in a specified order) to create the source for the compiler to process.
Haskell itself has only limited support for literate programming. Most importantly it lacks the ability to reorder chunks of code. (noweb or org-mode babel can be used with Haskell, of course.)