#2239: lack of improvement/reduction with TFs
----------------------------------------------+-----------------------------
  Reporter:  claus                            |          Owner:  simonpj        
 
      Type:  bug                              |         Status:  closed         
 
  Priority:  low                              |      Milestone:  7.0.1          
 
 Component:  Compiler (Type checker)          |        Version:  6.12.3         
 
Resolution:  fixed                            |       Keywords:  TF FD          
 
  Testcase:  indexed-types/should_fail/T2239  |      Blockedby:                 
 
Difficulty:  Unknown                          |             Os:  
Unknown/Multiple
  Blocking:                                   |   Architecture:  
Unknown/Multiple
   Failure:  None/Unknown                     |  
----------------------------------------------+-----------------------------
Changes (by simonpj):

  * status:  new => closed
  * testcase:  => indexed-types/should_fail/T2239
  * resolution:  => fixed


Comment:

 The new typechecker is happy with all these except `complexFD` and
 `complexTF` which fail in the same way
 {{{
 T2239.hs:43:13:
     Couldn't match expected type `b -> b'
                 with actual type `forall b1. MyEq b1 Bool => b1 -> b1'
     Expected type: (forall b1. MyEq b1 Bool => b1 -> b1) -> b -> b
       Actual type: (forall b1. MyEq b1 Bool => b1 -> b1)
                    -> forall b1. MyEq b1 Bool => b1 -> b1
     In the expression:
         id ::
           (forall b. MyEq b Bool => b -> b)
           -> (forall b. MyEq b Bool => b -> b)
     In an equation for `complexFD':
         complexFD
           = id ::
               (forall b. MyEq b Bool => b -> b)
               -> (forall b. MyEq b Bool => b -> b)

 T2239.hs:47:13:
     Couldn't match expected type `b -> b'
                 with actual type `forall b1. b1 ~ Bool => b1 -> b1'
     Expected type: (forall b1. b1 ~ Bool => b1 -> b1) -> b -> b
       Actual type: (forall b1. b1 ~ Bool => b1 -> b1)
                    -> forall b1. b1 ~ Bool => b1 -> b1
     In the expression:
         id ::
           (forall b. b ~ Bool => b -> b) -> (forall b. b ~ Bool => b -> b)
     In an equation for `complexTF':
         complexTF
           = id ::
               (forall b. b ~ Bool => b -> b) -> (forall b. b ~ Bool => b
 -> b)
 }}}
 To make them work you need to instantiate `id` at a polytype, which
 involves impredicativity.

 I've added the examples as a regression test though.

 Simon

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2239#comment:10>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to