Template Haskell does associated types poorly (printing & quoting)
When I say
{-# LANGUAGE TemplateHaskell, TypeFamilies #-}
{-# OPTIONS_GHC -ddump-splices -dsuppress-uniques #-}
module Bug where
$([d| class C a where
type F a
type F a = a |])
I get
[d| class C a where
type family F a
F a = a |]
======>
Bug.hs:6:7: Warning:
Cannot desugar this Template Haskell declaration:
class C a where
type family F a
F a = a
There are two problems here:
- This really should work.
- The pretty-printer here omits the
typeon the default definition forF. (The wordfamilyis optional there, but isn't actually wrong.)
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.10.2 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Template Haskell |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | |
| Operating system | |
| Architecture |