#1123: Impredicativity bug: forall not hoisted properly
--------------------------------------------------+-------------------------
 Reporter:  Ashley Yakeley <[EMAIL PROTECTED]>  |          Owner:  simonpj    
     Type:  bug                                   |         Status:  new        
 Priority:  normal                                |      Milestone:  6.10 branch
Component:  Compiler                              |        Version:  6.6        
 Severity:  normal                                |     Resolution:             
 Keywords:                                        |     Difficulty:  Unknown    
 Testcase:                                        |   Architecture:  Unknown    
       Os:  Unknown                               |  
--------------------------------------------------+-------------------------
Changes (by guest):

 * cc: [EMAIL PROTECTED] (added)

Comment:

 I believe I've run into this same bug with a simpler test case. runA2 is
 the one that I've prefer to be able to write but am unable to.

 {{{
 data A s = A { unA :: () }

 runA1 :: (forall s. A s) -> ()
 runA1 a = unA a

 -- doesn't work :(
 runA2 :: (forall s. A s) -> ()
 runA2 (A a) = a

 runA3 :: (forall s. A s) -> ()
 runA3 a = case a of A x -> x

 runA4 :: (forall s. A s) -> ()
 runA4 a = let A x = a in x

 runA5 :: (forall s. A s) -> ()
 runA5 a = go a
   where go (A a) = a
 }}}

 The following error is generated by GHC 6.8.3
 {{{
     Couldn't match expected type `forall s. A s'
            against inferred type `A s'
     In the pattern: A a
     In the definition of `runA2': runA2 (A a) = a
 }}}

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