allocVarsR len (TyVar src n v) = TyVar src n $ allocVarsR len v
allocVarsR len (TyFam src l f as) = TyFam src (addLen l len) f $ allocVarsR len `mapTys` as
--- | Like 'TyConst', but using 'noSource' and 'inj_Const'.
+-- | Like 'TyConst', but using 'noSource', 'inj_Len' and 'inj_Const'.
--
-- FIXME: remove @kc@ when GHC's #12933 is fixed.
tyConst ::
-- NOTE: The forall brings @c@ first in the type variables,
-- which is convenient to use @TypeApplications@.
--- | Like 'TyConst', but using 'noSource' and 'inj_Const'.
---
--- FIXME: remove @kc@ when GHC's #12933 is fixed.
+-- | Like 'tyConst', but not using 'inj_Len'.
tyConstLen ::
forall kc (c::kc) src vs.
Source src =>
instance ClassInstancesFor (#>)
instance TypeInstancesFor (#>)
+-- | Qualify a 'Type'.
(#>) ::
Source src =>
- Type src vs a ->
- Type src vs b ->
- Type src vs (a #> b)
-(#>) a b = (tyConstLen @(K (#>)) @(#>) (lenVars a) `tyApp` a) `tyApp` b
+ Type src vs q ->
+ Type src vs t ->
+ Type src vs (q #> t)
+(#>) q t = (tyConstLen @(K (#>)) @(#>) (lenVars q) `tyApp` q) `tyApp` t
infixr 0 #>
-- NOTE: should actually be (-1)
-- to compose well with @infixr 0 (->)@
proveConstraintFor _c _q = Nothing
instance TypeInstancesFor (#)
+-- | Unify two 'K.Constraint's.
(#) ::
Source src =>
Type src vs qx ->
proveConstraintFor _c _q = Nothing
instance TypeInstancesFor (#~)
+-- | Constraint two 'Type's to be equal.
(#~) ::
forall k a b src vs.
Source src =>
(#~) a b = (tyConstLen @(K (#~)) @(#~) (lenVars a) `tyApp` a) `tyApp` b
infixr 2 #~
-{-
-const_EqTy ::
- forall k src.
- Source src =>
- Typeable k =>
- Inj_Kind k =>
- Const src ((#~)::k -> k -> K.Constraint)
-const_EqTy = inj_Const @(#~)
--}
-
-- | /Type equality/.
eqType ::
Source src =>