I have a class that is defined as follows:
class (Eq a, Show a, Typeable a) => Condition v a where
(and some methods)
I wanted to write a function that accepts two conditions that have the same "v".
analyze :: (Condition v a, Condition v b) => a -> b -> Bool
(Return type made by Bool for simplicity)
But when I try to compile this, I get
Could not deduce (Condition v0 b)
arising from the ambiguity check for ‘analyze’
from the context (Condition v a, Condition v b)
So this cleanup does not output what I wanted to say, but instead introduced another variable of type v0.
Could you explain what is wrong with the wording of the type signature as I wrote it, and how to fix it? Fixes a problem of RankNTypes?
source
share