Bang patterns, ~ patterns, and lazy let
rjmh at cs.chalmers.se
Tue Feb 7 04:30:52 EST 2006
From: Ross Paterson <ross at soi.city.ac.uk>
John Hughes wrote:
>> I would urge that either we stick with the present design, or, if bang
>> patterns are added (which a lot speaks for), that the language be
>> simplified at the same time so that patterns are matched in the same way
>> everywhere, and BOTH warts above are excised. Some existing code would
>> break, but in return the language would become simpler and more expressive.
Would top-level bindings of constructor patterns and !x be evaluated
when the module was loaded (or at compile time)?
Yes. Nothing else makes sense, does it? If that's problematic (although
I can't see why it would be), just forbid strict patterns at the top
level of modules.
Load time rather than compile-time, I think--otherwise the compiled code
for a module could depend on the *code* of modules it imports, not just
on their interfaces, which would be harmful for separate compilation.
More information about the Haskell-prime