Skip to content

Haskell syntax sugar

Romeo Van Snick edited this page Jun 3, 2014 · 9 revisions

haskell

There's added support for better Haskell syntax. You could it using -XUnicodeSyntax, but this will possibly drive your coauthors crazy. If you want a less drastic approach and if you're a vim user, you could use vims conceal capabilities as I did in creep.vim.

You can also enable the highlighting for shell commands that return Haskell code, such as hoogle or pointfree using the hhl.sh script provided in the distribution. For example to highlight code returned from pointfree, use:

$ pointfree "Just 5 >>= (\ x -> x+5)" | hhl.sh

hhl

It even works on ghci! To do this use:

$ exec "`which ghci`" 2>&1 | hhl.sh

You now have a working ghci session that returns pretty-printed Haskell code. Feel free to modify the hhl.sh script to adapt things to your preferred color-scheme.

Clone this wiki locally