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,248
    • Issues 5,248
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 561
    • Merge requests 561
  • 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
  • #9433
Closed
Open
Issue created Aug 11, 2014 by hesselink@trac-hesselink

Partially applied type family allowed but unusable

I was playing around with the following code, which tries to map a type family over a type (something I thought would not be allowed):

{-# LANGUAGE
    TypeFamilies
  , KindSignatures
  #-}

type family Id x :: *
type instance Id a = a

type family Map (f :: * -> *) x :: *
type instance Map f [a] = [f a]

x :: Map Id [Bool]
x = []

Both GHC 7.8.3 and the current HEAD (7.9.20140811) accept this program! However, changing the definition of x to [True] gives an error:

    Couldn't match type ‘Id Bool’ with ‘Bool’
    Expected type: Map Id [Bool]
      Actual type: [Bool]
    In the expression: [True]
    In an equation for ‘x’: x = [True]

If I define y :: Id Bool with value True (which works fine) and define x = [y], I even get this error:

    Couldn't match type ‘Bool’ with ‘Id Bool’
    Expected type: Id Bool
      Actual type: Id Bool
    In the expression: y
    In the expression: [y]
Trac metadata
Trac field Value
Version 7.9
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
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