Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • GHC GHC
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 5,242
    • Issues 5,242
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 569
    • Merge requests 569
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Releases
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Glasgow Haskell CompilerGlasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #10811
Closed
Open
Issue created Aug 29, 2015 by Richard Eisenberg@raeDeveloper

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:

  1. This really should work.
  2. The pretty-printer here omits the type on the default definition for F. (The word family is 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
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking