Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data Kind src k where
- KiType :: src -> Kind src Type
- KiConstraint :: src -> Kind src Constraint
- KiFun :: src -> Kind src ka -> Kind src kb -> Kind src (ka -> kb)
- eqKind :: Kind xs x -> Kind ys y -> Maybe (x :~: y)
- type K (t :: kt) = kt
- class KindOf (a :: kt -> Type) where
- class (KindInjP (Ty_of_Type k), Type_of_Ty (Ty_of_Type k) ~ k) => KindInj k
- kindInj :: forall k src. Source src => KindInj k => Kind src k
- class KindInjP k where
- kindInjP :: src -> Kind src (Type_of_Ty k)
- data Ty
- type family Ty_of_Type (t :: Type) :: Type
- type family Type_of_Ty (t :: Type) :: Type
- data KindK src = KindK (Kind src k)
- data Con_Kind src
- = Con_Kind_Eq (KindK src) (KindK src)
- | Con_Kind_Arrow (KindK src)
- when_EqKind :: ErrorInj (Con_Kind src) err => Kind src x -> Kind src y -> ((x :~: y) -> Either err ret) -> Either err ret
- when_KiFun :: ErrorInj (Con_Kind src) err => SourceInj (KindK src) src => Kind src x -> (forall a b. (x :~: (a -> b)) -> Kind src a -> Kind src b -> Either err ret) -> Either err ret
Type Kind
data Kind src k where Source #
Singleton for kind types.
KiType :: src -> Kind src Type | |
KiConstraint :: src -> Kind src Constraint | |
KiFun :: src -> Kind src ka -> Kind src kb -> Kind src (ka -> kb) infixr 5 |
Type K
Class KindOf
class KindOf (a :: kt -> Type) where Source #
Return the Kind
of something.
Type KindInj
class (KindInjP (Ty_of_Type k), Type_of_Ty (Ty_of_Type k) ~ k) => KindInj k Source #
Implicit Kind
.
NOTE: GHC-8.0.1's bug #12933
makes it fail to properly build an implicit Kind
,
this can however be worked around by having the class instances
work on a data type Ty
instead of Type
,
hence the introduction of Ty
, Ty_of_Type
, Type_of_Ty
and KindP
.Inj
Instances
(KindInjP (Ty_of_Type k), Type_of_Ty (Ty_of_Type k) ~ k) => KindInj k Source # | |
Defined in Language.Symantic.Typing.Kind |
Type KindInjP
class KindInjP k where Source #
kindInjP :: src -> Kind src (Type_of_Ty k) Source #
Instances
KindInjP Constraint Source # | |
Defined in Language.Symantic.Typing.Kind kindInjP :: src -> Kind src (Type_of_Ty Constraint) Source # | |
KindInjP Ty Source # | |
Defined in Language.Symantic.Typing.Kind | |
(KindInjP a, KindInjP b) => KindInjP (a -> b) Source # | |
Defined in Language.Symantic.Typing.Kind kindInjP :: src -> Kind src (Type_of_Ty (a -> b)) Source # |
Type Ty
FIXME: workaround to be removed when #12933 will be fixed.
Instances
KindInjP Ty Source # | |
Defined in Language.Symantic.Typing.Kind | |
type Type_of_Ty Ty Source # | |
Defined in Language.Symantic.Typing.Kind |
Type family Ty_of_Type
type family Ty_of_Type (t :: Type) :: Type Source #
NOTE: As of GHC-8.0.2, using a closed type family does not work here,
this notably disables the expansion of Ty_of_Type
Any
.
Instances
type Ty_of_Type Type Source # | |
Defined in Language.Symantic.Typing.Kind | |
type Ty_of_Type Constraint Source # | |
Defined in Language.Symantic.Typing.Kind | |
type Ty_of_Type (a -> b) Source # | |
Defined in Language.Symantic.Typing.Kind |
Type family Type_of_Ty
type family Type_of_Ty (t :: Type) :: Type Source #
NOTE: As of GHC-8.0.2, using a closed type family does not work here,
this notably disables the expansion of Type_of_Ty
Any
.
Instances
type Type_of_Ty Constraint Source # | |
Defined in Language.Symantic.Typing.Kind | |
type Type_of_Ty Ty Source # | |
Defined in Language.Symantic.Typing.Kind | |
type Type_of_Ty (a -> b) Source # | |
Defined in Language.Symantic.Typing.Kind |
Type KindK
Existential for Kind
.
Type Con_Kind
Con_Kind_Eq (KindK src) (KindK src) | |
Con_Kind_Arrow (KindK src) |
Instances
Eq (Con_Kind src) Source # | |
Show (Con_Kind src) Source # | |
ErrorInj (Con_Kind src) (Error_Type src) Source # | |
Defined in Language.Symantic.Typing.Grammar errorInj :: Con_Kind src -> Error_Type src # | |
ErrorInj (Con_Kind src) (Error_Unify src) Source # | |
Defined in Language.Symantic.Typing.Unify errorInj :: Con_Kind src -> Error_Unify src # | |
ErrorInj (Con_Kind src) (Error_Term src) Source # | |
Defined in Language.Symantic.Compiling.Read errorInj :: Con_Kind src -> Error_Term src # |