[GHC] #4494: Another regression with type families

GHC cvs-ghc at haskell.org
Fri Nov 12 13:04:41 EST 2010


#4494: Another regression with type families
----------------------------------------+-----------------------------------
    Reporter:  rl                       |        Owner:                           
        Type:  bug                      |       Status:  new                      
    Priority:  normal                   |    Milestone:                           
   Component:  Compiler (Type checker)  |      Version:  7.1                      
    Keywords:                           |     Testcase:                           
   Blockedby:                           |   Difficulty:                           
          Os:  Unknown/Multiple         |     Blocking:                           
Architecture:  Unknown/Multiple         |      Failure:  GHC rejects valid program
----------------------------------------+-----------------------------------

Comment(by rl):

 This:

 {{{
 {-# LANGUAGE TypeFamilies, RankNTypes, FlexibleContexts,
 ScopedTypeVariables #-}

 module T4494 where

 type family H s a b

 class D (G v) => C v where
    type G v
    type F v
    foo :: v -> H (F v) (G v) v

 class D s where
    bar :: (forall t. Maybe t -> a) -> s -> H a s r -> r

 call :: forall v. C v => F v -> v
 call x = bar' (\_ -> x)
               (undefined :: G v)
               (foo (undefined :: v))

 bar' :: C v => (forall t. Maybe t -> F v) -> G v -> H (F v) (G v) v -> v
 bar' = bar
 }}}

 Why did you use !NoScopedTypeVariables instead of !ScopedTypeVariables?
 Must be Friday evening!

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4494#comment:5>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the Glasgow-haskell-bugs mailing list