The idea behind Data.Constraint.Forall, as I understand it, is to use coercion in the implementation, but ensure safety using the type system. I have two questions regarding the latter.
It is possible with an MPTC and functional dependency to identify the Skolem when it is a single variable, by using a constraint parameterized on a constraint. The trick I used to do that doesn't work when there are two.
From the perspective of code written outside of this module, the variables are Skolemized. They are effectively a 'fresh' type constructor.
But given that you can't refer explicitly to these types outside of the module since they aren't exported, any instance that covers these Skolems has to be universally quantified.
This is how I upgrade from an existential to a universal. The 'sign flip' comes from their unexported nature, not technically from their role as Skolems.
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