fgl
fgl copied to clipboard
Documentation updates for predicate functions that rely on match
Functions that rely on match
and also take a function involving Context
show expected, but poorly documented behavior.
The issue comes up when user functions that are supposed to operate on Context
s receive them as part of a recursive graph decomposition. As such, the graph that the contexts belong to gets smaller and smaller. User expectations are usually that if the starting graph has a particular context, that is the one that their function receives, as opposed to a context from a subsequent decomposition. This has come up before in #55 and #89.
I think this is at least a documentation fix, but it would also be useful to add some functions for mapping and folding over "full" contexts.
Would the maintainers be interested in pull requests for either?
I just saw 84a89c4e280059d59a8d73a5238d9951ffbec3f3, but I still wonder if the ramifications of recursively calling match should be spelled out somewhere.
In any case, I'm also still curious about the possibility of something like cmap :: Graph g => (Context a b -> Context c d) -> g a b -> g c d
or cfold :: Graph g => (Context a b -> c -> c) -> c -> g a b -> c
that do not recursively call match
. At the very least, it would be useful to have an efficient version of something that does Graph g => g a b -> [Context a b]
.