I am getting an error message like so:
Linear.hs:215:27:
Couldn't match expected type `forall v1.
Ident v1 =>
SubstT v1 (GenericLL (a v1 c)) n x'
with actual type `forall v1. Ident v1 => SubstT v1 a0 m0 b0'
Expected type: (forall v1.
Ident v1 =>
SubstT v1 (GenericLL (a v1 c)) n x)
-> n x
Actual type: (forall v1. Ident v1 => SubstT v1 a0 m0 b0) -> m0 b0
In the first argument of `flattenImpl', namely `runSubstT'
In the expression: flattenImpl runSubstT
The actual type seems more general than the expected type. What are then possible causes for this kind of error message? Is the message misleading or am I reading it incorrectly?
What I am trying to do is to pass an existentially quantified function runSubstT
, whose type is:
runSubstT :: (Monad m) => (forall v. (Ident v) => SubstT v a m b) -> m b
I will also settle with some good description of how the GHC compiler performs type matching on existentially quantified types.