[Haskell-cafe] What do _you_ want to see in FGL?
nccb2 at kent.ac.uk
Mon Apr 26 05:25:54 EDT 2010
Primarily I want to see in FGL: documentation, documentation and more
documentation. The library has lots of undocumented functions
(especially the queries, e.g.
has no documentation at all), and the only reference is the original
paper. I've seen several people who didn't read the paper (or didn't
read the right bits) get confused by the inductive way the graph is
constructed, when they try to de-construct it.
I would also like to see the library reduced in size/scope if possible;
there's a lot of modules in FGL, but all I've ever used are D.G.I.Graph,
D.G.I.Tree, D.G.I.Graphviz and D.G.I.Query.DFS. I consider this to
probably be the most common usage of the library by others too (if you
throw in D.G.I.Query.BFS). So by the sounds of it, if you split
Graphviz and Query off to separate libraries, I probably only use the
Ivan Lazar Miljenovic wrote:
> Here are some ideas that I have regarding FGL:
> * Better fundamental data structures: one of the things that has always
> annoyed me about FGL is how much it uses tuples; I propose re-defining
> the Context type to be a record-based data structure. Also, usage of
> Sets, Maps, etc. where applicable.
I think this is worth doing, even if it does break code. If you're
doing Context, you may as well do LNode and LEdge too.
> * Data.Graph.Inductive.Monad: does anyone actually use this?
No, now that I look at it, it's not what I would expect. It seems to be
a lot of operations that could be constructed by sticking liftM before
the normal operations. For example:
nodesM :: GraphM m gr => m (gr a b) -> m [Node]
I would have thought the useful operations for graphs and monads would
have been something more like:
nodesM :: GraphM m gr => gr (m a) (m b) -> m [Node]
On that node, I would like to see some instances for the graph types:
particularly Functor, Foldable and Traversable, for both (Gr a) and
(Flip Gr b) -- where Flip is
If you put FGL in a repository somewhere, I might be able to find some
time to write those instances and perhaps contribute a bit of
documentation (no promises, though!).
More information about the Haskell-Cafe