Skip to content
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

Question: Are lazy patricia trees and laziness necessary? #61

Closed
MisanthropicBit opened this issue Feb 14, 2017 · 1 comment
Closed

Comments

@MisanthropicBit
Copy link

I have recently read Martin Erwig's papers and looked over the fgl library. The graphs are backed by a Patricia tree through Data.IntMap which, as far as I can tell, defaults to Data.IntMap.Lazy.

I am currently considering porting parts of the fgl to another functional language that is strict by default, so I was wondering if the performance hinges on the lazy implementation or not? None of the papers mention laziness as a requirement for the backing data structure or even for the graph's implementation language, but I can understand why it would be the default in a language like Haskell.

@MisanthropicBit MisanthropicBit changed the title Are lazy patricia trees and laziness necessary? Question: Are lazy patricia trees and laziness necessary? Feb 14, 2017
@ivan-m
Copy link
Contributor

ivan-m commented Feb 14, 2017

I doubt it.

Note that strictness in this aspect refers to the keys/structure; the actual values in a strict IntMap remain lazy.

The only time laziness may play a part is in some kind of tying-the-knot aspect if e.g. you have a node's label be dependent upon its value (using newNodes or some such function), but then that's al algorithmic aspect and - at least in Haskell - that's where the laziness of the values can help.

@ivan-m ivan-m closed this as completed Feb 14, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants