I want to access type variables in an instance, that don't show up in the instance's parameters. For example,
class A a where foo :: a b
data C a
instance A C where
foo :: forall b. C b
foo = undefined :: C b
Of course, the above will resolve without the scoped type expression, but I have a non-toy example where I actually want it.
edit
please try your code before pasting it as an answer! The above (Daniel's answer) results in
Test.hs:51:5: Misplaced type signature: foo :: forall b. C b
Failed, modules loaded: none.