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
756 stars 115 forks source link

Please, check & find superflous `coerce` #986

Open Anton-Latukha opened 3 years ago

Anton-Latukha commented 3 years ago

During work on type shifts, the coerce gets sprinkled over the code.

Eventually, when types line-up - some of the coerce sprinkled over the codebase become superfluous (Path -> Path & such).

There probably shouldn't be many of them, but also finding & removing them would make the code not only cleaner also reducing their number - prevents type inference problems during work.

Anton-Latukha commented 2 years ago

Also: coerce $ <expr> $ coerce is coerce (<expr>).