3 ms·
The real benefit of using a strict-by-default language is that laziness shows up in types. That is, I can check the type of a variable, and tell whether it's gu
by catnaroek 11y ago
The real benefit of using a strict-by-default language is that laziness shows up in types. That is, I can check the type of a variable, and tell whether it's guaranteed to be a value (if it has type `Foo`), or it's a potentially still unforced thunk (if it has type `Lazy Foo`). For instance, the real type of lazy lists would be:
data Front a = Nil | Cons a (Stream a)
type Stream a = Lazy (Front a)
Haskell doesn't do this, not even with the Strict or StrictData pragmas.