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,333
    • Issues 4,333
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 371
    • Merge Requests 371
  • 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
  • Wiki
  • Functional dependencies in GHC

Last edited by Simon Peyton Jones Feb 01, 2021
Page history New page

Functional dependencies in GHC

This is the root page for examples and issues about functional dependencies in GHC.

Main sub-pages

IMPORTANT This list of sub-pages have most of the content!

  • Background and terminology
  • Key examples
  • Design choices

The rest this page gathers other useful links.

Key papers

  • Type classes with functional dependencies, Mark Jones, ESOP 2000. The original fundep paper.
  • Understanding functional dependencies via constraint handling rules, Sulzmann et al, JFP 2006. This journal paper has a lot of examples and we cite it frequently below as "JFP-paper".
  • Elaboration on functional dependencies, Karachalias and Schrijvers, Haskell Symposium 2017. This paper shows how to translate functional dependencies into type families.
  • Evidenced functional dependencies a wiki page developing the Karachalias and Schrijvers paper further.

Key proposals

  • Coverage condition: Per-instance DYSFUNCTIONAL pragma.
  • Instance consistency condition: Explore ways to weaken or abandon the Instance Consistency Condition.

GHC today

GHC today does this:

  • By default: GHC uses the strict coverage condition and imposes the Paterson conditions.

  • If UndecidableInstances is on, GHC

    • uses the liberal (not strict) coverage condition
    • lifts the Paterson conditions
  • Always: GHC implements liberal instance consistency unconditionally. See Note [Bogus consistency check] in GHC.Tc.Instance.Fundeps. (GHC presumably does this because SICC is incompatible with LCC.)

Clone repository

GHC Home
GHC User's Guide

Joining In

Newcomers info
Mailing Lists & IRC
The GHC Team

Documentation

GHC Status Info
Working conventions
Building Guide
Debugging
Commentary

Wiki

Title Index
Recent Changes