Safe Haskell | None |
---|---|
Language | Haskell2010 |
Core definitions. This module is internal and provides no guarantees about stability and safety of it's interface.
Documentation
Type that maps constraint to it's representation. You can get hold of
representation of some special constraints and classes that use
mkInst
.
For example:
class Bar a => Foo a where baz :: a qux :: a -> b -> [(a, b)] mkInst 'Foo
creates datatype instance:
type instance Inst (Foo a) = Dict (Foo a) data instance Dict (Foo a) = Foo{ _Bar :: Inst (Bar a) , baz :: a , qux :: forall b. a -> b -> [(a, b)] }
You can get hold of representation of global instance using inst
. You
are free to modify and read it and you can use (==>
) to apply it as
constraint in context of some subexpression. See mkInst
for more info
about format of generated representation.
inst :: forall c. c => Inst c Source #
Reflects constraint into correspoding representation - can be used to
access normal class instances from the environment. This function is meant
to be used with TypeApplications
when it's usage is ambiguous.
TODO: example