commercialhaskell / rio

A standard library for Haskell
Other
838 stars 54 forks source link

StrictData language extension #243

Closed ezoerner closed 1 year ago

ezoerner commented 2 years ago

The README states

Make data fields strict by default, unless you have a good reason to do otherwise.

but I don't see the StrictData language pragma in the recommended list. Is this an oversight?

snoyberg commented 2 years ago

I personally don't recommend it because it's a non-local change inverting the meaning of code. Looking at data Foo = Foo { bar: Int } I no longer know if bar is strict or lazy. I think StrictData is a better default, but prefer explicitness in the code. (Not everyone agrees with me on this of course.)