> > This thread is suggesting to add a special case -- one that seems to match > intuition, but it's still a special case. And my question is: should the > special case be for unboxed tuples? or should the special case be for any > pattern whose overall type is unlifted? >
My intuition would be: for all unlifted types. I'd submit that the distinction between lazy and strict pattern-matching doesn't really make a ton of sense for unlifted types. To implement lazy pattern-matching on an unlifted type, one has to actually indirect through another type, which I find deeply suspicious. That being said Right now, there is one rule: if the type of any variable bound in the > pattern is unlifted, then the pattern is an unlifter-var pattern and is > strict. The pattern must be banged, unless the bound variable is not > nested. This rule is consistent across all features. > I realise that there are a lot of subtil details to get right to specify pattern-matching. Or at the very least, that it's difficult to come up with a straightforward specification which is as clear as the one above. I'm wondering though: have there been discussions which led to the above rule, or did it just come to be, mostly informally? (and if there have been explicit discussions, are they recorded somewhere?)
_______________________________________________ ghc-devs mailing list [email protected] http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
