Skip to content

GitLab

  • Menu
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 4,866
    • Issues 4,866
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 461
    • Merge requests 461
  • 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 Compiler
  • GHCGHC
  • Issues
  • #4494
Closed
Open
Created Nov 12, 2010 by rl@cse.unsw.edu.au@trac-rl

Another regression with type families

Program (compile with !ScopedTypeVariables):

type family H s a b

class D (G v) => C v where
  type G v
  type F v
  foo :: v -> H (F v) (G v) v

class D s where
  bar :: (forall t. Maybe t -> a) -> s -> H a s r -> r

call :: forall v. C v => F v -> v
call x = bar (\_ -> x)
             (undefined :: G v)
             (foo (undefined :: v))

bar' :: C v => (forall t. Maybe t -> F v) -> G v -> H (F v) (G v) v -> v
bar' = bar

The current head (even with today's typechecker patch) complains:

    Could not deduce (H a (G v) v ~ H (F v) (G v) v)
      from the context (C v)

But if I change bar to bar' in the rhs of foo, it all works fine. 6.12.3 accepts both programs.

Trac metadata
Trac field Value
Version 7.1
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