haskell-nix / hnix

A Haskell re-implementation of the Nix expression language
https://hackage.haskell.org/package/hnix
BSD 3-Clause "New" or "Revised" License
768 stars 115 forks source link

Functionality for annotating each expression with its Scope or reduced form #995

Open expipiplus1 opened 3 years ago

expipiplus1 commented 3 years ago

It would be super useful to be able to annotate each expression with its scope. This would allow one to arbitrarily reduce/evaluate parts of the expression tree.

I'm sure that all the building blocks are here for this. At the moment scope generation is quite intertwined with evaluation/reduction, which as far as I can tell makes it a little tricky to get exactly what I want here.