3 ms·
As the post says, there is compiler option, StrictData. You can turn it on per file/module or for the whole project. Unless you know what you're doing (or are d
by unhammer 3y ago
As the post says, there is compiler option, StrictData. You can turn it on per file/module or for the whole project. Unless you know what you're doing (or are doing homework problems in algorithms and data structures), you probably want it on.
It interacts just fine – the extension (like !'s) just governs the constructors defined in the modules where you've turned it on. AFAIK there's no Haskell extension which can change the strictness of imported constructors. E.g. basic lists are lazy, so in your (StrictData) module with `data StrictInt = MkStrictInt Int` you can make a lazy value `x = (MkStrictInt 1) : x` of type `[StrictInt]` which uses strict constructors inside it (lazy spine, strict leaves).