-
Notifications
You must be signed in to change notification settings - Fork 13
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
Combine efforts on Data.Parameterized.Map and Data.Parameterized.Sum #62
Comments
Hi @Ericson2314 , Thanks for the heads-up about dependent-map and dependent-sum. It will be interesting to take a look at the similarities between these, but it's going to be something we will need to evaluate over a longer time period since we will need to evaluate the impact of any differences between the libraries. Out of curiosity, were there aspects of parameterized-utils that were problematic and led you to these alternate libraries? |
I think we just didn't know
Of course. Perhaps there is a "bottom up" way of doing this that could make the evaluation easier. For example a PR which leaves your map and just replaces some of the equality and ordering classes. Then if that looks good the Pair bits, then map, and so on. |
Indeed it is possible. I made obsidiansystems/constraints-extras#17 to demonstrate that. That means our classes should work for the AST uses (like crucible) where you have infinitely many possible GADT indices. |
FYI some of this stuff is now been peeled off and upstreamed in the even more minimal https://github.com/phadej/some CC @phadej |
Have you all seen http://hackage.haskell.org/package/dependent-map and http://hackage.haskell.org/package/dependent-sum ? We use and these a bunch at Obsidian and help maintain them. They ostensibly are the same as
Data.Parameterized.Map
Data.Parameterized.Sum
. It probably makes sense to join efforts in maintaining just one version / see if either of us is missing any extra functionality the other might find useful.After just a brief scroll, one difference is map equality---specifically the constraint on the values. Your
EqF
does not restrict the type parameter, whereas our http://hackage.haskell.org/package/constraints-extras/docs/Data-Constraint-Extras.html finitely enumerates the possible GADT indices. We are just switching to GHC 8.6, after which I hope it is possible to handle the countably infinite cases that arise in general (with indices and parameters) in that library with quantified constraints, yielding the best of both worlds. This is exactly the nice sort of insight that comes so much more readily from comparing two different implementations of the same idea.The text was updated successfully, but these errors were encountered: