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

coercion to NixString; iterNValue': flip 1st arg; unflip runFreshIdT #1005

Closed Anton-Latukha closed 3 years ago

Anton-Latukha commented 3 years ago

This PR is interesting in Utils & Value where things were updated to fixpoint combinators.

Which, if internally laziness is preserved - running the function & apply the argument to it only once & optimize during compilation.

In Haskell Core I found that fix sometimes roughly converts just to let x = f x in x (stays a basic let, letrec in terms of Core language).

So far I can not reason beyond Core, it is hard to say how letrec compiles.

This is a work I did before the Nix 2.4 release, which broke the CI on all fronts. I decided to not run putting created by upstream fires. Decided to not overcomplicate the Git processes for myself, so decided to finish & contribute the work first & then go do fix things.