Re: [GHC] #7481: Partially promoted data types

2012-12-05 Thread GHC
#7481: Partially promoted data types
-+--
Reporter:  simonpj   |   Owner:  
Type:  bug   |  Status:  new 
Priority:  high  |   Milestone:  7.8.1   
   Component:  Compiler  | Version:  7.6.1   
Keywords:|  Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  | Failure:  None/Unknown
  Difficulty:  Unknown   |Testcase:  
   Blockedby:|Blocking:  
 Related:|  
-+--
Changes (by goldfire):

 * cc: eir@… (added)


-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler

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


Re: [GHC] #7481: Partially promoted data types

2012-12-05 Thread GHC
#7481: Partially promoted data types
-+--
Reporter:  simonpj   |   Owner:  
Type:  bug   |  Status:  new 
Priority:  high  |   Milestone:  7.8.1   
   Component:  Compiler  | Version:  7.6.1   
Keywords:|  Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  | Failure:  None/Unknown
  Difficulty:  Unknown   |Testcase:  
   Blockedby:|Blocking:  
 Related:|  
-+--
Description changed by simonpj:

Old description:

> Consider
> {{{
> data D a where
>   D1 :: a -> D a
>   D2 :: (a~Int) => D a
>   D3 :: forall (a:k). Proxy a -> D b
>
> }}}
> Is `D` a promoted type?
>
> Well, `D1` is promotable, but `D2` is not because of constraints in its
> type, and neither is `D3` because it uses kind polymorphism.  It's a bit
> odd to promote only one of the three constructors, but that is what
> happens right now.
>
> We should probably check for promotability of all data constructors, and
> promote all or none.  A bit of fiddling around is need to do this, so I'm
> opening a ticket.  It's not terribly pressing.

New description:

 Consider
 {{{
 {-# LANGUAGE DataKinds, PolyKinds #-}

 data D a where
   D1 :: a -> D a
   D2 :: (a~Int) => D a
   D3 :: forall (a:k). Proxy a -> D b

 }}}
 Is `D` a promoted type?

 Well, `D1` is promotable, but `D2` is not because of constraints in its
 type, and neither is `D3` because it uses kind polymorphism.  It's a bit
 odd to promote only one of the three constructors, but that is what
 happens right now.

 We should probably check for promotability of all data constructors, and
 promote all or none.  A bit of fiddling around is need to do this, so I'm
 opening a ticket.  It's not terribly pressing.

--

-- 
Ticket URL: 
GHC 
The Glasgow Haskell Compiler

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