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
Add Dhall.Traverse #660
Add Dhall.Traverse #660
Conversation
This contains subExpressions, a traversal that visits all immediate sub-Expr's of an Expr. This is a fairly fundamental traversal, which is extremely useful when combined with idioms from Control.Lens.Plated, allowed for very easy rewriting of ASTs.
I lifted this from |
dhall.cabal
Outdated
@@ -170,6 +170,7 @@ Library | |||
Dhall.Pretty, | |||
Dhall.Repl, | |||
Dhall.TH, | |||
Dhall.Traverse, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could probably add this to Dhall.Core
. It seems like the most natural place to add optics for the Expr
type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did consider that, but it's a whopping big module. This options up a bit of potential for build parallelism, but I have no proof it actually helps. If you want it there, I'm happy to move it. I also considered claiming Dhall.Lens
as it's getting into lensy territory, but I have no idea what else would show up there. Can I defer to you to make a decision?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's stick to Dhall.Core
for now since it hasn't been a significant build bottleneck in my experience, yet. Usually the bottleneck is one of the Dhall.Parser.*
modules
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, moving it there, and reformatting to match your style, as it seems like this will be accepted.
Thanks! 🙂 |
This contains subExpressions, a traversal that visits all immediate
sub-Expr's of an Expr. This is a fairly fundamental traversal, which is
extremely useful when combined with idioms from Control.Lens.Plated,
allowed for very easy rewriting of ASTs.