-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce dictionary lookups and Maybes in the Graph API #11
Labels
Comments
Now that the alternatives were added, should we deprecate the functions |
I think it is the best approach, but gradually and at a new branch. |
I think that @jsbezerra's strategy is a good choice 😄 |
Solved and merged into master. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The API of module
Graph.Graph
forces frequent lookups into the association lists, which probably incurs a performance penalty. Also, its functions often returnMaybe
s where the result could be guaranteed to exist.In order to reduce these issues, a notion of "node context" could be introduced, which allows the user to access the incident edges of a node. This would make the lookups implicit, and the well-formedness of the graphs ensures that such lookups do not fail.
The following is a sketch of the additions/changes to
Graph.Graph
moduleAs an example of usage, this is an implementation of depth-first search using the contexts.
The text was updated successfully, but these errors were encountered: