4 ms·
Laziness is but one mistake in Haskell. It should not prevent you from using other parts of the language that are wonderful. There's a reason Mu exists, which i
by kccqzy 2y ago
Laziness is but one mistake in Haskell. It should not prevent you from using other parts of the language that are wonderful. There's a reason Mu exists, which is to take Haskell and make it strict by default: there are plenty of good things about Haskell even if you consider laziness to be a mistake.
(Of course a small minority of people don't consider laziness as a mistake as it enables equational reasoning; let's not go there.)
- tome 2y agoHaving used Mu I concluded that Haskell got function laziness correct. (Data type laziness is a different issue, but that can be solved by `StrictData`).
- kccqzy 2y agoThe problem with StrictData is that you need to convince every library in your dependency graph to switch to it, or provide strict versions of the data structures. Common container types like Map and Set do this. Your typical library implementing a domain-specific functionality does not.
- tome 2y agoYup, that's right. Libraries can expose the wrong thing, or just space leak internally. Here's an example: https://github.com/mrkkrp/megaparsec/issues/486 https://github.com/mrkkrp/megaparsec/issues/486