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,332
    • Issues 4,332
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 363
    • Merge Requests 363
  • 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
  • #1241

Closed
Open
Opened Mar 21, 2007 by guest@trac-guest

Functional dependency Coverage Condition is lifted, and should not be

Hello, GHC 6.6 (with flags -fglasgow-exts -fallow-undecidable-instances) is too liberal when accepting instances. Here is an example:

class F a b | a -> b where f :: (a,b)
instance F Int b

The instance violates the functional dependency constraint of F because (in theory) it can be used to solve both F Int Bool and F Int Char. In practice, it seems that some free variable gets bound upon the first use of f with a concrete type, leading to some rather confusing behavior. Example:

x :: (Int,a)
x = f
 
y :: (Int,Bool)
y = f
 
z :: (Int,Char)
z = x -- works, but 'z = f' does not

-Iavor

Edited Mar 09, 2019 by Simon Peyton Jones
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#1241