[Haskell-cafe] Interpreter output in color

Donald Bruce Stewart dons at cse.unsw.edu.au
Thu Dec 14 02:12:40 EST 2006


Forward to haskell-cafe at haskell.org for further discussion.

----- Forwarded message from Walter Moreira <gwallter at gmail.com> -----

Date: Thu, 14 Dec 2006 06:46:44 +0000
From: Walter Moreira <gwallter at gmail.com>
To: haskell at haskell.org
Subject: [Haskell] interpreter ouput in color

Hi all. I was wondering if some people miss the colored output
of some applications, such like the IPython enhanced shell. I've
been googling for similar options for Haskell but I found nothing.

I feel that the type error messages, for example, would be a lot
more readable (or at least quicker to read). Is there a way to write
plugins for ghci to get this?, or do you people have some suggestion
about what would be the easiest component to hack for applying colors?

Thank you. Cheers,
Walter

------------------------------------------------------------------------


Walter, I think this is a great idea.

Currently, there is an existing tool, HsColour:

    http://www.cs.york.ac.uk/fp/darcs/hscolour/

which does a great job of marking up source files to ansi, html and css
output. I think with only a little bit of effort, it could be integrated
into ghci (or a ghci wrapper written), that runs each expression in ghci
through HsColour. Here's a mockup (the result of dumping ghci's output
through HsColour):

    http://www.cse.unsw.edu.au/~dons/tmp/colour-ghci.png

Is someone interested in writing a wrapper over ghci that pipes input
and output through HsColour? We might have to modify HsColour slightly
to take input from stdin.

I've put up an initial wiki page for this here:

    http://haskell.org/haskellwiki/GHCi_in_colour

If you've thoughts on how to implement this- -- or want to just go ahead
and do it, please dive in!

-- Don


More information about the Haskell-Cafe mailing list