Strictness/laziness warnings

David Feuer david.feuer at gmail.com
Sun May 29 00:00:20 UTC 2016


There are certain patterns of strictness or laziness that signal the need
for extra caution. I'm wondering whether it might be possible to offer
warnings for different varieties of them, and pragmas suppressing the
warnings at the relevant sites. Some function behaviors that suggest extra
care:

1. Conditionally strict in an argument. In many cases, making it
unconditionally strict will improve performance.
2. Strict in an argument that is or could be a function or a newtype
wrapper around a function. This can be caused by  adding too much
strictness defensively or to plug a leak.
3. Lazy in a primitive argument like an Int. This could lead to unnecessary
boxing.

Any of these could occur in correct, efficient code. But I'd love to be
presented a list of warnings to check over, and a way to check items off
the list with pragmas.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20160528/d71d6d36/attachment.html>


More information about the ghc-devs mailing list