Can't Quote Instance Associated Types in Template Haskell
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]$
Trac metadata
| Trac field | Value |
|---|---|
| Version | 6.12.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Template Haskell |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |