Access an instance's constraints http://github.com/ryantrinkle/superconstraints
|Latest on Hackage:||0.0.2|
This package is not currently in any snapshots. If you're interested in using it, we recommend adding it to Stackage Nightly. Doing so will make builds more reliable, and allow stackage.org to host generated Haddocks.
A way of inferring instance constraints given an instance.
Suppose you have a class like this:
class C a instance C a => C [a]
C [a], you cannot obtain
C a; however, superconstraints allows you to add that capability:
class HasSuper (C a) => C a instance C a => C [a] makeSuper "C [a]"
Then, you can retrieve the superconstraint by doing:
case super (Proxy :: Proxy (C [a])) of Dict -> ...
The superconstraint dictionary will include all of the constraints required by the instance.
- Replace the crazy string argument to
makeSuperwith something more sensible