
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? Roman