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 = _
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 = _
b are not unified, and the
a ~ b constraint is not shown.
foo :: Show a => a -> Int foo x = _
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 = _
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.
In #9479 (closed), Dominique Devriese wants to see any constraints on an ambiguously-typed hole.
|Component||Compiler (Type checker)|