HsColour gets a new backend

This morning, people in #haskell were playing with colours and bold/underline style formatting in the IRC channel, having just discovered it was possible. Mauke took HsColour's output for ANSI terminal codes and wrote a perl script to translate it into IRC colour codes instead. Now, how could I live with that? - munging the output of a beautiful haskell program using a perl script that looks like pure line noise!

Hence, the emergence of a new pure haskell backend for HsColour: the -mirc formatting flag. It's actually really easy to create new backends, hence the growth from the original 2 (-tty and -html) to 5 formats now. In fact, it was 70 lines of haskell, against 89 lines of perl. Smaller, more beautiful, more readable, more maintainable.

And only yesterday, Christophe Poucet contributed another new feature to HsColour: the -lit flag for literate code. Obviously, you don't really want syntax highlighting on the main parts of the document, just in the embedded code fragments. So with a little cannibalisation of the unlit module in the Haskell 1.2 Report, voila, HsColour now only colourises the code, not the document.

This page is powered by Blogger. Isn't yours?