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,260
    • Issues 4,260
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge Requests 398
    • Merge Requests 398
  • 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
  • #15355

Closed
Open
Opened Jul 08, 2018 by Richard Eisenberg@raeDeveloper

Functional dependencies can get GHC to print "UnkSkol"

When I say

class C a b | a -> b where
  foo :: a -> b

instance C Int Bool where
  foo = (>0)

blah :: C Int Double => Int -> _a
blah = foo

I get

    • Couldn't match type ‘Double’ with ‘Bool’
        arising from a functional dependency between constraints:
          ‘C Int Bool’ arising from a use of ‘foo’ at Scratch.hs:51:8-10
          ‘C Int Double’ arising from UnkSkol at Scratch.hs:51:1-10
    • In the expression: foo
      In an equation for ‘blah’: blah = foo

There are actually two problems:

  1. If we replace _a with Double, GHC accepts the program. I'm not sure it should. But that's a larger problem than...
  2. ... when it prints the error, it says UnkSkol. It probably shouldn't.

This ticket is about the second problem, because the first one require more fundep love than is usually on offer around here.

Erroring here is reasonable enoug

Trac metadata
Trac field Value
Version 8.4.3
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
Assignee
Assign to
8.6.1
Milestone
8.6.1 (Past due)
Assign milestone
Time tracking
None
Due date
None
Reference: ghc/ghc#15355