| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Language.Symantic.Typing.Type
- data Type src vs t where
- tyConst :: forall kc c src vs. Source src => Inj_Len vs => Constable c => Inj_KindP (Ty_of_Type kc) => Type_of_Ty (Ty_of_Type kc) ~ kc => Type src vs c
- tyConstLen :: forall kc c src vs. Source src => Constable c => Inj_KindP (Ty_of_Type kc) => Type_of_Ty (Ty_of_Type kc) ~ kc => Len vs -> Type src vs c
- tyApp :: Source src => Type src vs f -> Type src vs a -> Type src vs (f a)
- tyVar :: Source src => NameVar -> Var src vs v -> Type src vs v
- tyFam :: forall kc c as vs src. Source src => Inj_Len vs => Constable c => Inj_KindP (Ty_of_Type kc) => Type_of_Ty (Ty_of_Type kc) ~ kc => Types src vs as -> Type src vs (Fam c as)
- tyQual :: Source src => Type src vs q -> Type src vs t -> (Qual q -> Type src vs t -> Type src vs (q #> t)) -> Type src vs (q #> t)
- data TypeK src vs kt = TypeK (Type src vs t)
- data TypeT src vs = TypeT (Type src vs t)
- data TypeVT src = TypeVT (Type src vs t)
- data Const src c where
- kindOfConst :: Const src (t :: kt) -> Kind src kt
- class (Typeable c, FixityOf c, ClassInstancesFor c, TypeInstancesFor c) => Constable c
- class ConstsOf a where
- class FixityOf c where
- data ConstC src = ConstC (Const src c)
- (~>) :: Source src => Constable (->) => Type src vs a -> Type src vs b -> Type src vs (a -> b)
- type family FunArg (fun :: Type) :: Type where ...
- type family FunRes (fun :: Type) :: Type where ...
- unTyFun :: forall t src tys. Inj_Source (TypeVT src) src => Constable (->) => Type src tys t -> Maybe (Type src tys (FunArg t), Type src tys (FunRes t))
- newtype q #> a = Qual (q => a)
- (#>) :: Source src => Type src vs a -> Type src vs b -> Type src vs (a #> b)
- class (x, y) => x # y
- (#) :: Source src => Type src vs qx -> Type src vs qy -> Type src vs (qx # qy)
- noConstraint :: Source src => Inj_Len vs => Type src vs (() :: Constraint)
- noConstraintLen :: Source src => Len vs -> Type src vs (() :: Constraint)
- class x ~ y => x #~ y
- (#~) :: forall k a b src vs. Source src => Typeable k => Inj_Kind k => Type src vs (a :: k) -> Type src vs (b :: k) -> Type src vs (a #~ b)
- eqType :: Source src => Type src tys (x :: k) -> Type src tys (y :: k) -> Maybe (x :~: y)
- eqTypeKi :: Source src => Type src tys (x :: kx) -> Type src tys (y :: ky) -> Maybe (x :~~: y)
- eqTypes :: Source src => Types src tys x -> Types src tys y -> Maybe (x :~~: y)
- ordType :: Source src => Type src tys (x :: kx) -> Type src tys (y :: ky) -> Ordering
- ordTypes :: Source src => Types src tys x -> Types src tys y -> Ordering
- data Qual q where
- class ClassInstancesFor c where
- proveConstraint :: Source src => Type src vs q -> Maybe (Qual q)
- inj_Const :: forall c src. Source src => Constable c => Inj_KindP (Ty_of_Type (K c)) => Type_of_Ty (Ty_of_Type (K c)) ~ K c => Const src c
- inj_ConstKi :: forall kc c src. Source src => Constable c => Kind src kc -> Const src (c :: kc)
- proj_Const :: forall c u src. Typeable c => Const src u -> Maybe (c :~: u)
- proj_ConstTy :: forall c u src vs. Typeable c => Type src vs u -> Maybe (c :~: u)
- proj_ConstKi :: forall kc c u src. Typeable c => kc ~ Type_of_Ty (Ty_of_Type kc) => Inj_KindP (Ty_of_Type kc) => Const src u -> Maybe (c :~~: u)
- proj_ConstKiTy :: forall kc c u src vs. Typeable c => kc ~ Type_of_Ty (Ty_of_Type kc) => Inj_KindP (Ty_of_Type kc) => Type src vs u -> Maybe (c :~~: u)
- eqConst :: Const src_x (x :: k) -> Const src_y (y :: k) -> Maybe (x :~: y)
- eqConstKi :: forall src_x src_y kx ky x y. Const src_x (x :: kx) -> Const src_y (y :: ky) -> Maybe (x :~~: y)
- ordConst :: forall src_x src_y kx ky x y. Const src_x (x :: kx) -> Const src_y (y :: ky) -> Ordering
- normalizeQualsTy :: Source src => Type src tys (t :: kt) -> TypeK src tys kt
- type family Fam (fam :: k) (hs :: [Type]) :: k
- class TypeInstancesFor c where
- class ExpandFam a where
- kindOfType :: Type src vs (t :: kt) -> Kind src kt
- normalizeVarsTy :: Type src vs (t :: kt) -> (forall vs'. Type src vs' (t :: kt) -> ret) -> ret
- data Types src vs ts where
- mapTys :: (forall kt t. Type src vs t -> Type src vs' t) -> Types src vs ts -> Types src vs' ts
- foldlTys :: (forall k t. Type src vs t -> acc -> acc) -> Types src vs ts -> acc -> acc
- class TypeOf a where
- data Proxy k t :: forall k. k -> * = Proxy
- data (k :~: a) b :: forall k. k -> k -> * where
- data a :~~: b where
- data Constraint :: *
Type Type
data Type src vs t where Source #
Constructors
| TyConst :: src -> Len vs -> Const src c -> Type src vs c | |
| TyApp :: src -> Type src vs f -> Type src vs a -> Type src vs (f a) | |
| TyVar :: src -> NameVar -> Var src vs v -> Type src vs v | |
| TyFam :: src -> Len vs -> Const src fam -> Types src vs hs -> Type src vs (Fam fam hs) |
Instances
| AllocVars k (Type k src) Source # | |
| Inj_Source (TypeVT src) src => TestEquality k (Type k src vs) Source # | |
| Inj_Source (TypeVT src) src => KindOf kt (Type kt src vs) Source # | |
| Source src => Eq (Type kt src vs t) Source # | |
| Source src => Sourced (Type kt src vs t) Source # | |
| UsedVarsOf (Type kt src vs t) Source # | |
| VarOccursIn (Type kt src vs t) Source # | |
| LenVars (Type kt src vs t) Source # | |
| ExpandFam (Type kt src vs t) Source # | |
| ConstsOf (Type kt src vs t) Source # | |
| Substable (Type kt src vs t) Source # | |
| type SourceOf (Type kt src vs t) Source # | |
| type VarsOf (Type kt src vs t) Source # | |
tyConst :: forall kc c src vs. Source src => Inj_Len vs => Constable c => Inj_KindP (Ty_of_Type kc) => Type_of_Ty (Ty_of_Type kc) ~ kc => Type src vs c Source #
tyConstLen :: forall kc c src vs. Source src => Constable c => Inj_KindP (Ty_of_Type kc) => Type_of_Ty (Ty_of_Type kc) ~ kc => Len vs -> Type src vs c Source #
tyFam :: forall kc c as vs src. Source src => Inj_Len vs => Constable c => Inj_KindP (Ty_of_Type kc) => Type_of_Ty (Ty_of_Type kc) ~ kc => Types src vs as -> Type src vs (Fam c as) Source #
tyQual :: Source src => Type src vs q -> Type src vs t -> (Qual q -> Type src vs t -> Type src vs (q #> t)) -> Type src vs (q #> t) infix 1 Source #
Qualify a Type.
Type TypeK
Type TypeT
Existential for Type.
Type TypeVT
Existential polymorphic Type.
Type Const
kindOfConst :: Const src (t :: kt) -> Kind src kt Source #
Class Constable
class (Typeable c, FixityOf c, ClassInstancesFor c, TypeInstancesFor c) => Constable c Source #
Instances
| (Typeable kc c, FixityOf kc c, ClassInstancesFor kc c, TypeInstancesFor kc c) => Constable kc c Source # | |
Class ConstsOf
Class FixityOf
Type ConstC
Type '(->)'
(~>) :: Source src => Constable (->) => Type src vs a -> Type src vs b -> Type src vs (a -> b) infixr 0 Source #
The function Type (->),
with an infix notation more readable.
Type family FunArg
Type family FunRes
unTyFun :: forall t src tys. Inj_Source (TypeVT src) src => Constable (->) => Type src tys t -> Maybe (Type src tys (FunArg t), Type src tys (FunRes t)) Source #
Return, when the given Type is a function,
the argument of that function.
Type (#>)
newtype q #> a infixr 0 Source #
Type constant to qualify a Type.
Constructors
| Qual (q => a) |
Instances
| TypeInstancesFor (Constraint -> Type -> *) (#>) Source # | |
| ClassInstancesFor (Constraint -> Type -> *) (#>) Source # | |
| FixityOf (Constraint -> Type -> *) (#>) Source # | |
Class (#)
class (x, y) => x # y infixr 2 Source #
Constraint union.
Instances
| (x, y) => x # y Source # | |
| TypeInstancesFor (Constraint -> Constraint -> Constraint) (#) Source # | |
| ClassInstancesFor (Constraint -> Constraint -> Constraint) (#) Source # | |
| FixityOf (Constraint -> Constraint -> Constraint) (#) Source # | |
noConstraint :: Source src => Inj_Len vs => Type src vs (() :: Constraint) Source #
noConstraintLen :: Source src => Len vs -> Type src vs (() :: Constraint) Source #
Class (#~)
class x ~ y => x #~ y infixr 2 Source #
Type equality Constraint.
Instances
| (~) k x y => (#~) k x y Source # | |
| TypeInstancesFor (k -> k -> Constraint) ((#~) k) Source # | |
| (Inj_Kind k2, Typeable Type k2) => ClassInstancesFor (k2 -> k2 -> Constraint) ((#~) k2) Source # | |
| FixityOf (k -> k -> Constraint) ((#~) k) Source # | |
(#~) :: forall k a b src vs. Source src => Typeable k => Inj_Kind k => Type src vs (a :: k) -> Type src vs (b :: k) -> Type src vs (a #~ b) infixr 2 Source #
eqType :: Source src => Type src tys (x :: k) -> Type src tys (y :: k) -> Maybe (x :~: y) Source #
Type equality.
eqTypeKi :: Source src => Type src tys (x :: kx) -> Type src tys (y :: ky) -> Maybe (x :~~: y) Source #
Heterogeneous type equality:
return two proofs when two Types are equals:
one for the type and one for the kind.
Comparison
ordType :: Source src => Type src tys (x :: kx) -> Type src tys (y :: ky) -> Ordering Source #
Compare two Types.
Type Qual
Captures the proof of a Constraint
(and its dictionaries when it contains type classes):
pattern matching on the Dict constructor
brings the Constraint into scope.
Class ClassInstancesFor
class ClassInstancesFor c where Source #
Instances
| ClassInstancesFor Constraint () Source # | |
| ClassInstancesFor (Constraint -> Type -> *) (#>) Source # | |
| ClassInstancesFor (Constraint -> Constraint -> Constraint) (#) Source # | |
| (Inj_Kind k2, Typeable Type k2) => ClassInstancesFor (k2 -> k2 -> Constraint) ((#~) k2) Source # | |
Injection
inj_Const :: forall c src. Source src => Constable c => Inj_KindP (Ty_of_Type (K c)) => Type_of_Ty (Ty_of_Type (K c)) ~ K c => Const src c Source #
inj_ConstKi :: forall kc c src. Source src => Constable c => Kind src kc -> Const src (c :: kc) Source #
Projection
proj_Const :: forall c u src. Typeable c => Const src u -> Maybe (c :~: u) Source #
Like proj_ConstKi, but with kind equality already known.
proj_ConstTy :: forall c u src vs. Typeable c => Type src vs u -> Maybe (c :~: u) Source #
Like proj_Const, but on a Type.
proj_ConstKi :: forall kc c u src. Typeable c => kc ~ Type_of_Ty (Ty_of_Type kc) => Inj_KindP (Ty_of_Type kc) => Const src u -> Maybe (c :~~: u) Source #
XXX: proj_ConstKi must be given the kc kind explicitely,
when used multiple times in the same pattern match,
because of GHC's #12933.
proj_ConstKiTy :: forall kc c u src vs. Typeable c => kc ~ Type_of_Ty (Ty_of_Type kc) => Inj_KindP (Ty_of_Type kc) => Type src vs u -> Maybe (c :~~: u) Source #
Like proj_ConstKi, but on a Type.
eqConstKi :: forall src_x src_y kx ky x y. Const src_x (x :: kx) -> Const src_y (y :: ky) -> Maybe (x :~~: y) Source #
ordConst :: forall src_x src_y kx ky x y. Const src_x (x :: kx) -> Const src_y (y :: ky) -> Ordering Source #
Type family Fam
Class TypeInstancesFor
class TypeInstancesFor c where Source #
Methods
expandFamFor :: Source src => proxy c -> Len vs -> Const src fam -> Types src vs ts -> Maybe (Type src vs (Fam fam ts)) Source #
Instances
| TypeInstancesFor Constraint () Source # | |
| TypeInstancesFor (Constraint -> Type -> *) (#>) Source # | |
| TypeInstancesFor (Constraint -> Constraint -> Constraint) (#) Source # | |
| TypeInstancesFor (k -> k -> Constraint) ((#~) k) Source # | |
Class ExpandFam
normalizeVarsTy :: Type src vs (t :: kt) -> (forall vs'. Type src vs' (t :: kt) -> ret) -> ret Source #
Remove unused Vars from ther context.
Type Types
mapTys :: (forall kt t. Type src vs t -> Type src vs' t) -> Types src vs ts -> Types src vs' ts Source #
Class TypeOf
Minimal complete definition
data Proxy k t :: forall k. k -> * #
A concrete, poly-kinded proxy type
Constructors
| Proxy |
Instances
| (ModuleFor k src ss s, Inj_ModulesR src ss rs) => Inj_ModulesR src ss ((:) * (Proxy k s) rs) Source # | |
| (Gram_Term_AtomsFor k src ss g t, Gram_Term_AtomsR src ss rs g) => Gram_Term_AtomsR src ss ((:) * (Proxy k t) rs) g Source # | |
| Inj_SymP k * Zero ((:) * (Proxy k s) ss) s Source # | |
| Monad (Proxy *) | |
| Functor (Proxy *) | |
| Applicative (Proxy *) | |
| Foldable (Proxy *) | |
| Traversable (Proxy *) | |
| Generic1 (Proxy *) | |
| Alternative (Proxy *) | |
| MonadPlus (Proxy *) | |
| (Inj_KindP (Ty_of_Type (K k c)), (~) * (K k c) (Type_of_Ty (Ty_of_Type (K k c))), Constable k c, Inj_Name2Type [*] cs) => Inj_Name2Type [*] ((:) * (Proxy k c) cs) Source # | |
| Bounded (Proxy k s) | |
| Enum (Proxy k s) | |
| Eq (Proxy k s) | |
| Ord (Proxy k s) | |
| Read (Proxy k s) | |
| Show (Proxy k s) | |
| Ix (Proxy k s) | |
| Generic (Proxy k t) | |
| Semigroup (Proxy k s) | |
| Monoid (Proxy k s) | |
| type Rep1 (Proxy *) | |
| type Rep (Proxy k t) | |
data (k :~: a) b :: forall k. k -> k -> * where infix 4 #
Propositional equality. If a :~: b is inhabited by some terminating
value, then the type a is the same as the type b. To use this equality
in practice, pattern-match on the a :~: b to get out the Refl constructor;
in the body of the pattern-match, the compiler knows that a ~ b.
Since: 4.7.0.0
Heterogeneous propositional equality: like (:~:) but prove also that the kinds are equal.
data Constraint :: * #
The kind of constraints, like Show a
Instances
| Inj_KindP Constraint Source # | |
| TypeInstancesFor Constraint () Source # | |
| ClassInstancesFor Constraint () Source # | |
| FixityOf Constraint c Source # | |
| TypeInstancesFor (Constraint -> Type -> *) (#>) Source # | |
| TypeInstancesFor (Constraint -> Constraint -> Constraint) (#) Source # | |
| ClassInstancesFor (Constraint -> Type -> *) (#>) Source # | |
| ClassInstancesFor (Constraint -> Constraint -> Constraint) (#) Source # | |
| FixityOf (Constraint -> Type -> *) (#>) Source # | |
| FixityOf (Constraint -> Constraint -> Constraint) (#) Source # | |
| TypeInstancesFor (k -> k -> Constraint) ((#~) k) Source # | |
| (Inj_Kind k2, Typeable Type k2) => ClassInstancesFor (k2 -> k2 -> Constraint) ((#~) k2) Source # | |
| FixityOf (k -> k -> Constraint) ((#~) k) Source # | |
| type Type_of_Ty Constraint Source # | |
| type Ty_of_Type Constraint Source # | |