Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data ForceI :: (Nat -> *) -> Atom kon -> * where
- type MetaVarI = ForceI (Const Int)
- data Annotate (x :: *) (f :: k -> *) :: k -> * where
- type MetaVarIK ki = NA (Annotate Int ki) (Const Int)
- metavarGet :: MetaVarIK ki at -> Int
- metavarAdd :: Int -> MetaVarIK ki at -> MetaVarIK ki at
- metavarIK2Int :: Exists (MetaVarIK ki) -> Int
- metavarI2Int :: Exists MetaVarI -> Int
- metavarI2IK :: MetaVarI ix -> MetaVarIK ki ix
Documentation
data ForceI :: (Nat -> *) -> Atom kon -> * where Source #
Given a functor from Nat
to *
, lift it to work over Atom
by forcing the atom to be an I
.
Instances
Eq (Exists (MetaVarI :: Atom kon -> Type)) Source # | |
Ord (Exists (MetaVarI :: Atom kon -> Type)) Source # | |
Defined in Data.HDiff.MetaVar compare :: Exists MetaVarI -> Exists MetaVarI -> Ordering # (<) :: Exists MetaVarI -> Exists MetaVarI -> Bool # (<=) :: Exists MetaVarI -> Exists MetaVarI -> Bool # (>) :: Exists MetaVarI -> Exists MetaVarI -> Bool # (>=) :: Exists MetaVarI -> Exists MetaVarI -> Bool # max :: Exists MetaVarI -> Exists MetaVarI -> Exists MetaVarI # min :: Exists MetaVarI -> Exists MetaVarI -> Exists MetaVarI # |
data Annotate (x :: *) (f :: k -> *) :: k -> * where Source #
This is isomorphic to const x &&& f
on the type level.
Instances
type MetaVarIK ki = NA (Annotate Int ki) (Const Int) Source #
A MetaVarIK
can be over a opaque type and a recursive position
We keep the actual value of the constant around purely because
sometimes we need to compare the indexes for equality. It is possible
to remove that but this will require some instance like IsNat
to be bubbled up all the way to generics-mrsop.
TODO: add a IsOpq
instance and remove Annotate altogether.
we need a method with type defOpq :: Proxy k -> ki k
,
we can then piggyback on testEquality
for ki.
The HasIKProjInj
instance is part of this same hack.
metavarGet :: MetaVarIK ki at -> Int Source #
Returns the metavariable forgetting about type information
Existential MetaVars
metavarIK2Int :: Exists (MetaVarIK ki) -> Int Source #
Retrieves the int inside a existential MetaVarIK
metavarI2IK :: MetaVarI ix -> MetaVarIK ki ix Source #
Injects a metavar over recursive positions into one over opaque types and recursive positions