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,274
    • Issues 4,274
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 412
    • Merge Requests 412
  • 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
  • #8707

Closed
Open
Opened Jan 27, 2014 by Richard Eisenberg@raeDeveloper

Kind inference fails in data instance definition

Consider the following shenanigans:

{-# LANGUAGE DataKinds, PolyKinds, TypeFamilies, GADTs #-}

data family SingDF (a :: (k, k2 -> *))
data Ctor :: k -> *

data instance SingDF (a :: (Bool, Bool -> *)) where
  SFalse :: SingDF '(False, Ctor)

HEAD reports (with -fprint-explicit-kinds)

    Data constructor ‛SFalse’ returns type ‛SingDF
                                              Bool k '('False, Ctor k)’
      instead of an instance of its parent type ‛SingDF Bool Bool a’
    In the definition of data constructor ‛SFalse’
    In the data instance declaration for ‛SingDF’

I see two problems here:

  1. Kind inference should fix the problem. If I add a kind annotation to Ctor, the code works. GHC should be able to infer this kind annotation for me.

  2. The error message is not particularly helpful. GHC 7.6.3 had a more verbose, but more helpful message.

Trac metadata
Trac field Value
Version 7.7
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
9.2.1
Milestone
9.2.1
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#8707