Simon Peyton-Jones:
> |   - We need to distinguish between open and closed newtypes in a
> number of
> |     places, because looking through newtypes doesn't work easily for
> open ones.
> 
> I couldn't see where this "bites" except in TcTyDecls when computing
> recursiveness.

There are a few of places where GHC looks through newtypes:
      * MkExternalCore.collect_tdefs, the computation of `repclause'
      * SimplUtils.mkCase1 (here it actually reconstucts the worker
        unfolding)
      * Coercion.splitNewTypeRepCo_maybe

> The place where "looking through" newtypes is decided upon is in
> BuildTyCl line 145.  I've added some more comments to explain; and also
> in TyCon.
> 
> If we make (some, non-recursive) newtypes transparent again, we might
> have to remember *not* to make open ones transparent! 

Part of the aim of the patch to which this log messages belongs is to
achieve exactly that.  If I got it right, making some newtypes
transparent again should work fine without further tweaks.  (Open ones
will always be treated as opaque, ie like recursive ones).

Manuel

> | 
> |     M ./compiler/basicTypes/DataCon.lhs -3 +5
> |     M ./compiler/basicTypes/MkId.lhs -4 +26
> |     M ./compiler/coreSyn/MkExternalCore.lhs -1 +1
> |     M ./compiler/deSugar/DsUtils.lhs -1 +1
> |     M ./compiler/simplCore/SimplUtils.lhs -2 +2
> |     M ./compiler/typecheck/TcPat.lhs -1 +10
> |     M ./compiler/types/Coercion.lhs -2 +2
> |     M ./compiler/types/TyCon.lhs -1 +10
> |     M ./compiler/types/Type.lhs -5 +4
> | _______________________________________________
> | Cvs-ghc mailing list
> | [EMAIL PROTECTED]
> | http://www.haskell.org/mailman/listinfo/cvs-ghc

_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to