3 ms·
Bindings in the `where` clause can still access names in the main binding: https://wiki.haskell.org/Let_vs._Where#Advantages_of_where https://wiki.haskell.org/L
by yawaramin 8y ago
Bindings in the `where` clause can still access names in the main binding: https://wiki.haskell.org/Let_vs._Where#Advantages_of_where https://wiki.haskell.org/Let_vs._Where#Advantages_of_where
This runs the risk of strongly coupling them to the main binding and making them less reusable. IMHO strong coupling where two bindings are aware of each others' internals should be avoided.
- cannabis_sam 8y agoLike your link says: doesn’t lambda lifting solve that problem? That’s what I always do if I want to move an auxillary function to the top-level for reusing elsewhere.
- yawaramin 8y agoIndeed, I also prefer lifting, especially internally inside a module. It jives with the idea of loose coupling, strong cohesion.