-XStrict: Why some binders are not made strict?

Roman Cheplyaka roma at ro-che.info
Fri Dec 11 12:57:10 UTC 2015

On 12/11/2015 02:21 PM, Johan Tibell wrote:
> If we force strictness all the way down it's not really call-by-value
> either, because the caller doesn't know what to evaluate (I think).

Not sure what you mean here.

> In addition, making pattern matching strict in this way makes it hard to
> mix and match strict and lazy data types (e.g. Maybe), because using a
> lazy data type from another module will make it appear strict in your
> code (hurting modularity).

I don't think this is a case about modularity. A lazy Maybe value
defined in a lazy module remains lazy; and you can pass it to lazy
functions without forcing it. Only when you pattern match on it *in the
strict module*, the evaluation happens.

As I said, I prefer this semantics mainly because it's easier to
explain: all variables (and underscores) bound in a strict module refer
to WHNF values. Do you have a similarly simple explanation for the
semantics you're suggesting?


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20151211/b7b220c7/attachment.sig>

More information about the ghc-devs mailing list