[Haskell-cafe] Visualising a type class hierarchy

Andre Pang ozone at algorithm.com.au
Wed May 12 21:29:19 EDT 2004

Hey all,

Does anyone know of a good way to visualise ("graph") a type class 
hierarchy, including one with multiple-parameter type classes?  The 
traditional "inherits from" arrows used in graphs of object-oriented 
classes doesn't deal very well with type classes.  A simple case, such 

     class Super a

     class Super a => Sub a

     instance Super SuperType
     instance Super SubType
     instance Sub   SubType

works fine, but once you get into situations such as:

     class SuperMulti a b

     class SubMulti a b c | a b -> c

     instance SuperMulti a Foo => SubMulti a Bar c

I haven't found elegant ways of visualising this at all: how do you 
draw arrows from SuperMulti to SubMulti, for instance?  Has anyone else 
had a go at this?

% Andre Pang : trust.in.love.to.save

More information about the Haskell-Cafe mailing list