#179: Instance match failure on openTypeKind
--------------------------------------+-------------------------------------
  Reporter:  simonpj                  |          Owner:  simonpj 
      Type:  bug                      |         Status:  assigned
  Priority:  normal                   |      Milestone:          
 Component:  Compiler (Type checker)  |        Version:  6.4.1   
  Severity:  normal                   |     Resolution:  None    
  Keywords:                           |             Os:  Unknown 
Difficulty:  Unknown                  |   Architecture:  Unknown 
--------------------------------------+-------------------------------------
Changes (by simonmar):

  * architecture:  => Unknown
  * difficulty:  => Unknown
  * version:  None => 6.4.1
  * os:  => Unknown

Old description:

> {{{
> Consider
>
>     instance Show (a->b) where ...
>
>     foo x = show (\ _ -> True)
>
> This fails with:
>     No instance for (Show (t -> Bool))
>       arising from use of `show' at Foo.hs:5
>

> Reason: the type of (\_ -> True) is  (t -> Bool) where
> t has an "openTypeKind".  It's possible that the function
> will be applied to say an Int#, and the openTypeKind
> records that this is OK.
>
> BUT, the instance decl Show (a->b) has
> a::liftedTypeKind, and that doesn't match an
> openTypeKind type variable.
>

> This bug relates to GHC's unsatisfactory treatment of
> the variants of kind "type", for which there are at least 2
> other SourceForge bugs registered (753780 and
> 753777).  It's very obscure, so I'm not going to fix it
> today.
> }}}

New description:

 {{{
 Consider

     instance Show (a->b) where ...

     foo x = show (\ _ -> True)

 This fails with:
     No instance for (Show (t -> Bool))
       arising from use of `show' at Foo.hs:5


 Reason: the type of (\_ -> True) is  (t -> Bool) where
 t has an "openTypeKind".  It's possible that the function
 will be applied to say an Int#, and the openTypeKind
 records that this is OK.

 BUT, the instance decl Show (a->b) has
 a::liftedTypeKind, and that doesn't match an
 openTypeKind type variable.


 This bug relates to GHC's unsatisfactory treatment of
 the variants of kind "type", for which there are at least 2
 other SourceForge bugs registered (753780 and
 753777).  It's very obscure, so I'm not going to fix it
 today.
 }}}

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