On 25/04/2009, at 17:32, Max Bolingbroke wrote:

2009/4/25 Roman Leshchinskiy <r...@cse.unsw.edu.au>:
On 25/04/2009, at 04:20, Ian Lynagh wrote:

Fri Apr 24 05:47:54 PDT 2009  Ian Lynagh <ig...@earth.li>
* Require a bang pattern when unlifted types are where/let bound; #3182

FWIW, I find this quite counterintuitive and it also breaks existing code. #3182 seems to be an unrelated bug report. What is the real ticket number?

Yeah, I'm also not convinced about this change. The real ticket is
#2806. http://hackage.haskell.org/trac/ghc/ticket/2806

Thanks Max, I now understand the reasoning behind this change a bit better. However, I'm still not convinced that it is a good idea, mainly because it introduces a tight coupling between two otherwise unrelated language extensions, breaks backwards compatibility and also perhaps compatibility to other compilers (AFAIK, jhc implements unboxed types but not bang patterns, for instance). I also never considered the issue it is intended to solve as a problem, to be honest. If you understand the semantics of unlifted types it should be quite obvious. I know I have to be careful about strictness when working with unlifted types. I don't think I have ever had a bug related to binding unlifted variables. On the other hand, I'm sure I will routinely forget to add the bangs and burn cycles on syntax that is, strictly speaking, not necessary.

As to uniformity and forgetting about patterns for the moment, this change breaks the following equality:

  let v = e1 in e2   =   (\v -> e1) e2

This is quite unfortunate, IMO.

Roman


_______________________________________________
Cvs-ghc mailing list
Cvs-ghc@haskell.org
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to