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,249
    • Issues 5,249
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 581
    • Merge requests 581
  • 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
  • #714
Closed
Open
Issue created Mar 07, 2006 by claus.reinke@talk21.com@trac-claus.reinke

Inconsistency between handling functional dependencies in class and signature constraints

the user's guide claims

  1. 4.2 3. There are no restrictions on the context in a class declaration (which introduces superclasses), except that the class hierarchy must be acyclic.

and we also have

  1. 4.3.1 1. Each universally quantified type variable tvi must be reachable from type

suggesting that FDs are taken into account when considering reachability

but that only seems to work for signature, not for class constraints, as the attached example shows. I wouldn't go so far as claiming this as a bug, but it prevents an otherwise straightforward encoding of ATS in FDs (where the superclass encodes the type function, see last month's discussion on haskell-cafe).

[grr, there isn't a button for attachment on this form, so I'll paste the code]

{-# OPTIONS_GHC -fglasgow-exts #-}
class C a b | a -> b
class C a b => D a
f :: C a b => a
f = undefined
Trac metadata
Trac field Value
Version 6.5
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system Unknown
Architecture Unknown
Edited Mar 09, 2019 by Simon Peyton Jones
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
Time tracking