#7347: Existential data constructors should not be promoted
-------------------------------+--------------------------------------------
  Reporter:  simonpj           |          Owner:                  
      Type:  bug               |         Status:  merge           
  Priority:  normal            |      Milestone:                  
 Component:  Compiler          |        Version:  7.6.1           
Resolution:  fixed             |       Keywords:                  
        Os:  Unknown/Multiple  |   Architecture:  Unknown/Multiple
   Failure:  None/Unknown      |     Difficulty:  Unknown         
  Testcase:  polykinds/T7347   |      Blockedby:                  
  Blocking:                    |        Related:                  
-------------------------------+--------------------------------------------
Changes (by simonpj):

  * status:  closed => merge


Comment:

 After further discussion with Richard and Stephanie we decided to promote
 data constructors where
  * The type constructor has no kind polymorphism; indeed has kind `* ->
 .... -> *`.
  * The data constructor has no constraints (equality or otherwise) in its
 type
  * The argument types of the data constructor are all promotable

 This restores the 7.6.1 behaviour, and that turns out to be useful for
 Richard and/or Pedro.

 I'm not sure why Stefan's original bug report is a bug. In his example
 {{{
   data K = forall a. T a  -- promotion gives 'T :: forall k. k -> K

   data G :: K -> * where
     D :: G (T [])
 }}}
 the promoted kind of `'T` is poly-kinded, and that makes its use in `D`
 fine.  So currently it is accepted and I think we agree it should be.

 The reminaing open issue concerns data types that have some promotable and
 some non-promotable constructors, but I'll open a new ticket for that.

 Ian, I this this should merge smoothly onto 7.6.1, along with a doc patch
 that I'll commit shortly.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/7347#comment:16>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to