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,931
    • Issues 4,931
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 464
    • Merge requests 464
  • 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
  • #15147
Closed
Open
Created May 13, 2018 by nfrisby@trac-nfrisby

Type checker plugin receives Wanteds that are not completely unflattened

With the following, a plugin will receive a wanted constraint that includes a fsk flattening skolem.

-- "Reduced" via the plugin
type family F u v where {}
type family G a b where {}

data D p where
  DC :: (p ~ F x (G () ())) => D p

(Please ignore the apparent ambiguity regarding x; the goal is for the plugin to eliminate any ambiguity.)

A do-nothing plugin that merely logs its inputs gives the following for the ambiguity check on DC.

given
  [G] $d~_a4oh {0}:: (p_a4o2[sk:2] :: *)
                     ~ (p_a4o2[sk:2] :: *) (CDictCan)
  [G] $d~~_a4oi {0}:: (p_a4o2[sk:2] :: *)
                      ~~ (p_a4o2[sk:2] :: *) (CDictCan)
  [G] co_a4od {0}:: (G () () :: *)
                    ~# (fsk_a4oc[fsk:0] :: *) (CFunEqCan)
  [G] co_a4of {0}:: (F x_a4o3[sk:2] fsk_a4oc[fsk:0] :: *)
                    ~# (fsk_a4oe[fsk:0] :: *) (CFunEqCan)
  [G] co_a4og {1}:: (fsk_a4oe[fsk:0] :: *)
                    ~# (p_a4o2[sk:2] :: *) (CTyEqCan)
derived
wanted
  [WD] hole{co_a4or} {3}:: (F x_a4o6[tau:2] fsk_a4oc[fsk:0] :: *)
                           ~# (p_a4o2[sk:2] :: *) (CNonCanonical)
untouchables [fsk_a4oe[fsk:0], fsk_a4oc[fsk:0], x_a4o3[sk:2], p_a4o2[sk:2]]

Note the fsk_a4oc[fsk:0] tyvar in the Wanted constraint, which is why I'm opening this ticket. Its presence contradicts the "The wanteds will be unflattened and zonked" claim from https://ghc.haskell.org/trac/ghc/wiki/Plugins/TypeChecker\#Callingpluginsfromthetypechecker section.

Trac metadata
Trac field Value
Version 8.4.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Compiler (Type checker)
Test case
Differential revisions
BlockedBy
Related
Blocking
CC adamgundry
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