Labelled graphs in fgl

Christian Maeder Christian.Maeder at
Thu Feb 14 05:13:35 EST 2008

Henning Thielemann wrote:
> 'gr a b', but 'a' is not an index type. The nodes are indexed by Node
> which is a synonym for Int. For the tasks I had so far there was no need
> for the label type 'a', I just needed a more specific index type than Node
> (=Int), say an enumeration.
>  The library designer seems to appreciate that applications may not need
> the labels, and provided functions like mkUGraph and type synonyms like
> Data.Graph.Inductive.Tree.UGr = Gr () (), which seems for me the wrong way
> around. It would be simple to add labels to an arbitrary indexed but
> unlabeled graph, say Ix i => gr i.

I agree that Ix (or only Ord) may be desirable as node types, but still
some applications may need more sophisticated labels
or may want to change the labels associated to nodes. For these cases I
don't see how you get rid of specializations to "()" without duplicating
the library.


More information about the Libraries mailing list