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,968
    • Issues 4,968
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 474
    • Merge requests 474
  • 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
  • #10954
Closed
Open
Created Oct 09, 2015 by David Feuer@treeowlReporter

Add class/context information to typed hole relevant bindings

GHC's typed hole messages don't currently include any known context information for relevant bindings. For example:

bar :: a ~ b => a -> b -> Int
bar x y = _

gets me

    Found hole ‘_’ with type: Int
    Relevant bindings include
      y :: b (bound at <interactive>:8:42)
      x :: a (bound at <interactive>:8:40)
      bar :: a -> b -> Int (bound at <interactive>:8:36)
    In the expression: _
    In an equation for ‘bar’: bar x y = _

The types a and b are not unified, and the a ~ b constraint is not shown.

foo :: Show a => a -> Int
foo x = _

gets me

    Found hole ‘_’ with type: Int
    Relevant bindings include
      x :: a (bound at <interactive>:4:36)
      foo :: a -> Int (bound at <interactive>:4:32)
    In the expression: _
    In an equation for ‘foo’: foo x = _

The Show constraint is lost.

What I want

I'd like context information for all type variables in known bindings, so I can see all the pieces available to help me fill in the hole.

Related ticket

In #9479 (closed), Dominique Devriese wants to see any constraints on an ambiguously-typed hole.

Trac metadata
Trac field Value
Version 7.10.2
Type FeatureRequest
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related #9479 (closed)
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