[Haskell-cafe] Graph type

C K Kashyap ckkashyap at gmail.com
Sun Jun 13 13:15:44 EDT 2010

I am trying to write a routine that would generate a graph - where each
vertex would be a string.

type Graph v = [(v,[v])]  -- list of tuples of vertices and adjacent
vertices list

addEdgeToGraph :: Graph -> String -> String -> Graph

I am having trouble coming up with the body of this function - that takes
the original graph, and an edge (string -> string) and the produces the new

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20100613/eeb964e4/attachment.html

More information about the Haskell-Cafe mailing list