Re: [GHC] #7224: Polymorphic kind annotations on type classes don't always work as expected

2012-10-11 Thread GHC
#7224: Polymorphic kind annotations on type classes don't always work as 
expected
+---
  Reporter:  slindley   |  Owner:   
  Type:  bug| Status:  closed   
  Priority:  normal |  Milestone:   
 Component:  Compiler (Type checker)|Version:  7.6.1-rc1
Resolution:  fixed  |   Keywords:  kind polymorphism
Os:  Unknown/Multiple   |   Architecture:  Unknown/Multiple 
   Failure:  GHC rejects valid program  | Difficulty:  Unknown  
  Testcase:  polykinds/T7224|  Blockedby:   
  Blocking: |Related:   
+---
Changes (by igloo):

  * status:  merge = closed
  * resolution:  = fixed


Comment:

 Merged as c4aa0165bb8eb4b65d8c1299fdff279e1f97bbb4

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7224#comment:5
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


Re: [GHC] #7224: Polymorphic kind annotations on type classes don't always work as expected

2012-09-18 Thread GHC
#7224: Polymorphic kind annotations on type classes don't always work as 
expected
+---
Reporter:  slindley |   Owner:  
 
Type:  bug  |  Status:  merge   
 
Priority:  normal   |   Milestone:  
 
   Component:  Compiler (Type checker)  | Version:  7.6.1-rc1   
 
Keywords:  kind polymorphism|  Os:  Unknown/Multiple
 
Architecture:  Unknown/Multiple | Failure:  GHC rejects valid 
program
  Difficulty:  Unknown  |Testcase:  polykinds/T7224 
 
   Blockedby:   |Blocking:  
 
 Related:   |  
+---
Changes (by simonpj):

  * status:  new = merge
  * difficulty:  = Unknown
  * testcase:  = polykinds/T7224


Comment:

 Thanks for the report.  The declaration of {{{PMonad'}}} is bogus becuase
 you are using a ''kind'' variable `i` in a ''type'', the type of
 {{{ret'}}}.  Now GHC says
 {{{
 T7224.hs:10:19:
 Kind variable `i' used as a type
 In the type `a - m i i a'
 In the class declaration for PMonad'
 }}}
 Merge to 7.6 branh.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7224#comment:3
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


Re: [GHC] #7224: Polymorphic kind annotations on type classes don't always work as expected

2012-09-18 Thread GHC
#7224: Polymorphic kind annotations on type classes don't always work as 
expected
+---
Reporter:  slindley |   Owner:  
 
Type:  bug  |  Status:  merge   
 
Priority:  normal   |   Milestone:  
 
   Component:  Compiler (Type checker)  | Version:  7.6.1-rc1   
 
Keywords:  kind polymorphism|  Os:  Unknown/Multiple
 
Architecture:  Unknown/Multiple | Failure:  GHC rejects valid 
program
  Difficulty:  Unknown  |Testcase:  polykinds/T7224 
 
   Blockedby:   |Blocking:  
 
 Related:   |  
+---

Comment(by slindley):

 Ah yes. Kind variables bound at the top level of a type class definition
 are in scope for the rest of the class definition. I guess (if the GHC
 type system was suitably adapted) it might actually be useful to allow
 kind variables in types.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7224#comment:4
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


Re: [GHC] #7224: Polymorphic kind annotations on type classes don't always work as expected

2012-09-17 Thread GHC
#7224: Polymorphic kind annotations on type classes don't always work as 
expected
---+
 Reporter:  slindley   |  Owner:
 
 Type:  bug| Status:  new   
 
 Priority:  normal |  Component:  Compiler (Type 
checker)
  Version:  7.6.1-rc1  |   Keywords:  kind polymorphism 
 
   Os:  Unknown/Multiple   |   Architecture:  Unknown/Multiple  
 
  Failure:  GHC rejects valid program  |   Testcase:
 
Blockedby: |   Blocking:
 
  Related: |  
---+

Comment(by simonpj@…):

 commit 77b63e74454170bd658c6773b9d5c172920d5cc5
 {{{
 Author: Simon Peyton Jones simo...@microsoft.com
 Date:   Mon Sep 10 13:13:24 2012 +0100

 Two fixes to kind unification

 * Don't unify a kind signature-variable with non-tyvar kind
 * Don't allow a kind variable to appear in a type
   (Trac #7224)

  compiler/typecheck/TcHsType.lhs |9 +++--
  compiler/typecheck/TcUnify.lhs  |   20 ++--
  2 files changed, 21 insertions(+), 8 deletions(-)
 }}}

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7224#comment:2
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


Re: [GHC] #7224: Polymorphic kind annotations on type classes don't always work as expected

2012-09-09 Thread GHC
#7224: Polymorphic kind annotations on type classes don't always work as 
expected
---+
 Reporter:  slindley   |  Owner:
 
 Type:  bug| Status:  new   
 
 Priority:  normal |  Component:  Compiler (Type 
checker)
  Version:  7.6.1-rc1  |   Keywords:  kind polymorphism 
 
   Os:  Unknown/Multiple   |   Architecture:  Unknown/Multiple  
 
  Failure:  GHC rejects valid program  |   Testcase:
 
Blockedby: |   Blocking:
 
  Related: |  
---+

Comment(by slindley):

 If I'd actually switched on PolyKinds in ghci as well as the source file,
 then I'd have got:

 {{{
 *Main :t ret
 ret :: PMonad k m = a - m i i a
 *Main :t ret'
 ret' :: PMonad' m = a - m BOX BOX a
 }}}

 (The mysterious * disappears if {{{PolyKinds}}} is enabled.)

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7224#comment:1
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


[GHC] #7224: Polymorphic kind annotations on type classes don't always work as expected

2012-09-06 Thread GHC
#7224: Polymorphic kind annotations on type classes don't always work as 
expected
---+
 Reporter:  slindley   |  Owner:
 
 Type:  bug| Status:  new   
 
 Priority:  normal |  Component:  Compiler (Type 
checker)
  Version:  7.6.1-rc1  |   Keywords:  kind polymorphism 
 
   Os:  Unknown/Multiple   |   Architecture:  Unknown/Multiple  
 
  Failure:  GHC rejects valid program  |   Testcase:
 
Blockedby: |   Blocking:
 
  Related: |  
---+
 Consider the following code for defining Atkey-style parameterised monads:

 {{{
 {-# LANGUAGE
 PolyKinds
  #-}

 class PMonad m where
   ret  :: a - m i i a
   bind :: m i j a - (a - m j k b) - m i k b
 class PMonad' (m :: i - i - * - *) where
   ret'  :: a - m i i a
   bind' :: m i j a - (a - m j k b) - m i k b
 }}}

 The following types are inferred for {{{ret}}} and {{{ret'}}}:

 {{{
 *Main :t ret
 ret :: PMonad * m = a - m i i a
 *Main :t ret'
 ret' :: PMonad' m = a - m BOX BOX a
 }}}

 But {{{ret'}}} should have the former type.

-- 
Ticket URL: http://hackage.haskell.org/trac/ghc/ticket/7224
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