#4135: Can't Quote Instance Associated Types in Template Haskell
-------------------------------+--------------------------------------------
    Reporter:  Ashley Yakeley  |       Owner:                           
        Type:  bug             |      Status:  new                      
    Priority:  normal          |   Component:  Template Haskell         
     Version:  6.12.1          |    Keywords:                           
          Os:  Linux           |    Testcase:                           
Architecture:  x86_64 (amd64)  |     Failure:  GHC rejects valid program
-------------------------------+--------------------------------------------
 Give this a whirl:
 {{{
 {-# LANGUAGE TypeFamilies,TemplateHaskell #-}
 module Bug where

     class C a where
         type T a

     $([d|
         instance C (Maybe a) where
             type T (Maybe a) = Char
         |])
 }}}

 {{{
 $ ghc -c Bug.hs
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Loading package ffi-1.0 ... linking ... done.
 Loading package array-0.3.0.0 ... linking ... done.
 Loading package containers-0.3.0.0 ... linking ... done.
 Loading package pretty-1.0.1.1 ... linking ... done.
 Loading package template-haskell ... linking ... done.

 Bug.hs:7:6:
     Type indexes must match class instance head
     Found `Maybe a[aMy]' but expected `Maybe a[aMx]'
     In the associated type instance for `T'
     In the instance declaration for `C (Maybe a[aMx])'
 [glastonbury:~/Projects/Haskell/Truth/Core]$
 }}}

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