Safe Haskell | None |
---|---|
Language | Haskell2010 |
Support for operating on Barbie-types with constrained functions.
Instance dictionaries
is evidence that there exists an instance of Dict
c ac a
.
It is essentially equivalent to Dict (c a)
from the
constraints package,
but because of its kind, it allows us to define things like
.Dict
Show
requiringDict :: (c a => r) -> Dict c a -> r Source #
Turn a constrained-function into an unconstrained one that uses the packed instance dictionary instead.
Getting constraints
class c (f a) => ClassF c f a Source #
ClassF
has one universal instance that makes
equivalent to ClassF
c f ac (f a)
. However, we have
'ClassF c f :: k -> Constraint
This is useful since it allows to define constraint-constructors like
ClassF
Monoid
Maybe
Instances
c (f a) => ClassF (c :: k1 -> Constraint) (f :: k2 -> k1) (a :: k2) Source # | |
Defined in Barbies.Internal.Dicts |
class c (f a) (g a) => ClassFG c f g a Source #
Like ClassF
but for binary relations.
Instances
c (f a) (g a) => ClassFG (c :: k1 -> k2 -> Constraint) (f :: k3 -> k1) (g :: k3 -> k2) (a :: k3) Source # | |
Defined in Barbies.Internal.Dicts |