[Hat] Proposal, Hierarchical module structure for tools

Thomas Davie tom.davie at gmail.com
Wed Oct 11 09:32:00 EDT 2006


>
> The way I do terminal codes in Hoogle is to define a type, TagStr:
>
> data TagStr = Str String | Tags [TagStr] | Underline TagStr | Bold
> TagStr | Color Int TagStr
>
> Now instead of dumping out escape codes, I dump out TagStr's, and then
> have a routine that converts from TagStr -> String with escape codes.
> This has the massive advantage that on OS's that don't support escape
> codes, I can use exactly the same generation code, and then drop the
> escape codes very simply.

You should note that this is in large part what hat already does.   
Look at the Highlight Module.

Bob

>>         HatCoverText -> Tracing.Hat.Coverage.ANSIterm
>
> The name ANSIterm makes me uneasy, Terminal perhaps? ANSIterm just
> looks ugly, and the case of it is weird compared to the rest of
> Haskell.
>
> In general we now seem to be pretty much in agreement about the
> proposed structure.

I can't see any major problems with it.

Bob


More information about the Hat mailing list