[Haskell-cafe] FGL problem: cannot acces data constructor NodeMap

Ivan Lazar Miljenovic ivan.miljenovic at gmail.com
Sat Jul 24 09:03:49 EDT 2010

CC-ing haskell-cafe again:

Immanuel Normann <immanuel.normann at googlemail.com> writes:

> 2010/7/24 Ivan Lazar Miljenovic <ivan.miljenovic at gmail.com>
>> Immanuel Normann <immanuel.normann at googlemail.com> writes:
>> > Afterall, my purpose is to get access to the map in a NodeMap and finally
>> to
>> > apply lookup to it. But I don't know how to access the map from a NodeMap
>> > (the map selector isn't accessible either).
>> You're not meant to; the point of NodeMap is to serve as a wrapper
>> around the normal graph types, not for you to use directly (exactly the
>> same as why the constructor for Map isn't exported).
>> May I ask, however, why you want to use Data.Graph.Inductive.NodeMap?
> Some of my lnodes in the graph have by construction unique labels and I want
> to lookup the lnode from a graph given only the label of that lnode.

Well, from my understanding NodeMap doesn't do what you want, since it
assumes that _all_ of the node labels are unique.  Furthemore, the way
of using it seems to be analogous of how one would use a State monad
rather than for actual interactive use throughout.

Ivan Lazar Miljenovic
Ivan.Miljenovic at gmail.com

More information about the Haskell-Cafe mailing list