At this line
type SafeReturn a = Exception e => Either e a
I got this warning
Variable ‘e’ is implicitly quantified due to a context
Use explicit forall syntax instead.
What does it mean?
You have a free type variable in your type synonym which you haven't dealt with. To take the extreme example, if we removed your a
parameter, we'd have something like
type SafeReturn = [e] -- Using a * -> * type instead of a * -> * -> * type
This probably isn't what you want since we don't know know exactly what e
is referring to here and this is the same problem that your SafeReturn
faces; what does the e
mean?
Now there is one context where e
could mean something and that's what the error message is telling you.
type SafeReturn a = forall e. Exception e => Either e a
This means something different. In fact you've created a universally quantified type here. This means that anything of type SafeReturn a
has no way of inspecting e
other than whatever methods are offered by Exception
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With