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,251
    • Issues 5,251
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 576
    • Merge requests 576
  • 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
  • #15710
Closed
Open
Issue created Oct 05, 2018 by Simon Peyton Jones@simonpjDeveloper

Should GHC accept a type signature that needs coercion quantification?

Consider

f :: forall k (f :: k) (x :: k1). (k ~ (k1 -> *)) => f x
f = error "uk"

Should we accept it? Now that we have coercion quantification (Trac #15497 (closed)), I think the answer should be yes, with the elaborated signature being

f :: forall k (f::k) (x::k1). forall (co :: k ~# (k1->*)). (f |> co) x

But there is a problem: the user wrote k ~ (k1 -> *), and that's a boxed value that we can't take apart in types. I'm not sure what to do here.

These thoughts arose when contemplating Note [Emitting the residual implication in simplifyInfer] in TcSimplify; see ticket:15710#comment:161240 in #15497 (closed)

Edited Mar 10, 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