Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data a :~~: b where
- data Var src vs v where
- varZ :: forall src vs kv v. Source src => LenInj vs => KindInj kv => Var src (Proxy v ': vs) v
- kindOfVar :: Var src vs (v :: kv) -> Kind src kv
- eqVar :: Var xs vs x -> Var ys vs y -> Maybe (x :~: y)
- eqVarKi :: Var xs vs x -> Var ys vs y -> Maybe ((x :: kx) :~~: (y :: ky))
- ordVarKi :: Var xs vs x -> Var ys vs y -> Ordering
- data EVar src vs = EVar (Var src vs v)
- type IndexVar = Int
- indexVar :: Var src vs v -> Int
- class LenVars a where
- class AllocVars a where
- appendVars :: AllocVars a => AllocVars b => LenVars (a vs_x x) => LenVars (b vs_y y) => VarsOf (a vs_x x) ~ vs_x => VarsOf (b vs_y y) ~ vs_y => a vs_x (x :: kx) -> b vs_y (y :: ky) -> (a (vs_x ++ vs_y) x, b (vs_x ++ vs_y) y)
- newtype NameVar = NameVar Text
- class VarOccursIn a where
- type family VarsOf a :: [Type]
- data Vars src vs where
- lookupVars :: NameVar -> Vars src vs -> Maybe (EVar src vs)
- insertVars :: NameVar -> Kind src k -> Vars src vs -> (forall vs'. Vars src vs' -> ret) -> ret
- data EVars src = EVars (Vars src vs)
- data UsedVars src vs vs' where
- lookupUsedVars :: Var src vs v -> UsedVars src vs vs' -> Maybe (Var src vs' v)
- insertUsedVars :: Var src vs v -> UsedVars src vs vs' -> Maybe (UsedVars src vs (Proxy v ': vs'))
- class UsedVarsOf a where
- type family UnProxy (x :: Type) :: k where ...
Documentation
Heterogeneous propositional equality: like (:~:) but prove also that the kinds are equal.
Type Var
data Var src vs v where Source #
A type variable, indexed amongst a type-level list.
v
is wrapped within a Proxy
to have a kind-heterogeneous list.
varZ :: forall src vs kv v. Source src => LenInj vs => KindInj kv => Var src (Proxy v ': vs) v Source #
Comparison
Type EVar
Type IndexVar
Class LenVars
Class AllocVars
class AllocVars a where Source #
allocVarsL :: Len len -> a vs x -> a (len ++ vs) x Source #
allocVarsR :: Len len -> a vs x -> a (vs ++ len) x Source #
appendVars :: AllocVars a => AllocVars b => LenVars (a vs_x x) => LenVars (b vs_y y) => VarsOf (a vs_x x) ~ vs_x => VarsOf (b vs_y y) ~ vs_y => a vs_x (x :: kx) -> b vs_y (y :: ky) -> (a (vs_x ++ vs_y) x, b (vs_x ++ vs_y) y) Source #
Type NameVar
Class VarOccursIn
class VarOccursIn a where Source #
Test whether a given Var
occurs within something.
VarOccursIn (Types src vs ts) Source # | |
VarOccursIn (Type kt src vs t) Source # | |
Type family VarsOf
type family VarsOf a :: [Type] Source #
Return the Var
context of something.
type VarsOf (Vars src vs) Source # | |
type VarsOf (TypeT src vs) Source # | |
type VarsOf (UsedVars src vs vs') Source # | |
type VarsOf (Types src vs ts) Source # | |
type VarsOf (TypeK src vs ki) Source # | |
type VarsOf (Var kv src vs v) Source # | |
type VarsOf (Type kt src vs t) Source # | |
type VarsOf (Term src ss ts vs t) Source # | |
Type Vars
data Vars src vs where Source #
Growable list of Var
s.
insertVars :: NameVar -> Kind src k -> Vars src vs -> (forall vs'. Vars src vs' -> ret) -> ret Source #
Type EVars
Type UsedVars
insertUsedVars :: Var src vs v -> UsedVars src vs vs' -> Maybe (UsedVars src vs (Proxy v ': vs')) Source #
Class UsedVarsOf
class UsedVarsOf a where Source #
usedVarsOf :: UsedVars (SourceOf a) (VarsOf a) vs -> a -> (forall vs'. UsedVars (SourceOf a) (VarsOf a) vs' -> ret) -> ret Source #
UsedVarsOf (Types src vs ts) Source # | |
UsedVarsOf (Type kt src vs t) Source # | |