3 ms·
You can somewhat switch Haskell to being strict-by-default with the new Strict/StrictData pragma[0], which should be in GHC 8.0. There's also a great write-up o
by Tehnix 11y ago
You can somewhat switch Haskell to being strict-by-default with the new Strict/StrictData pragma[0], which should be in GHC 8.0. There's also a great write-up of it here [1].
As someone else mentioned, Backpack is trying to "fix" the module system in Haskell[2], which should be interesting. That said, I don't have much of a problem with it, but then again I haven't seen the light of the OCaml way yet :)
[0] https://ghc.haskell.org/trac/ghc/wiki/StrictPragma https://ghc.haskell.org/trac/ghc/wiki/StrictPragma
[1] http://blog.johantibell.com/2015/11/the-design-of-strict-haskell-pragma.html http://blog.johantibell.com/2015/11/the-design-of-strict-has...
[2] http://plv.mpi-sws.org/backpack/ http://plv.mpi-sws.org/backpack/
- catnaroek 11y agoThe 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.