Literate Haskell
Last night I spent a while wrestling with latex, vim, make and ghc as part of my source-code reorganisation. One of the things I've been wanting for quite a while, is a vim syntax highlighting mode that understands the LaTeX literate Haskell syntax and displays both the Haskell code and the LaTeX code properly. Last night, I finally got it to work, though it has taken a bit of hackery in my Haskell files: I need to have a comment in every file so that the highlighter can detect the LaTeX.
This is a problem as the LaTeX detection heuristic appears to be:
- Look for a \documentclass macro (the begining of a LaTeX document); or
- Look for a LaTeX command; or
- Assume that the "literate" part is not LaTeX
I'm also using the listings package to pretty-print the Haskell code and my next goal is to use its custom keyword handling capabilities to