Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
GHC
GHC
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 4,249
    • Issues 4,249
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 394
    • Merge Requests 394
  • Requirements
    • Requirements
    • List
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Security & Compliance
    • Security & Compliance
    • Dependency List
    • License Compliance
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Glasgow Haskell Compiler
  • GHCGHC
  • Issues
  • #17296

Closed
Open
Opened Oct 03, 2019 by Chuck@chuck

TH-reified data family instances lack arguments since 8.8

Summary

Before GHC 8.8, data family instances' arguments were available from reify. In GHC 8.8, they are not.

Steps to reproduce

Create two files:

ReportErr1.hs

module ReportErr1 where
import Language.Haskell.TH.Syntax

reportOnDataFamily :: Name -> Q a
reportOnDataFamily familyName = do
  fam <- reify familyName
  case fam of
    FamilyI _ xs -> fail $ "Here is my report: " <> show xs
    _ -> fail ":("

ReportErr2.hs

{-# LANGUAGE TypeFamilies #-}

import ReportErr1

data family Foo :: * -> *

data instance Foo Bool

$(reportOnDataFamily ''Foo)

Build:

$ ghc -dynamic ReportErr1
$ ghc ReportErr2

Expected behavior

The instance's argument Bool should be available. It was before 8.8:

8.4.4        Here is my report: [DataInstD [] Main.Foo [ConT GHC.Types.Bool] Nothing [] []]
8.6.4        Here is my report: [DataInstD [] Main.Foo [ConT GHC.Types.Bool] Nothing [] []]
8.6.5        Here is my report: [DataInstD [] Main.Foo [ConT GHC.Types.Bool] Nothing [] []]
8.8.1        Here is my report: [DataInstD [] Nothing (ConT Main.Foo) Nothing [] []]
8.9.20190601 Here is my report: [DataInstD [] Nothing (ConT Main.Foo) Nothing [] []]

In describing this change, the 8.8 release notes say that the data family instances' arguments should be available in the Type field. The Type field is to contain "the data family name applied to its arguments", but here it contains only the data family name.

Environment

  • GHC version used: 8.8.1

Optional:

  • Operating System: NixOS
  • System Architecture: x86_64
Assignee
Assign to
8.8.2
Milestone
8.8.2 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#17296