| Copyright | (c) Erich Gut |
|---|---|
| License | BSD3 |
| Maintainer | zerich.gut@gmail.com |
| Safe Haskell | None |
| Language | Haskell2010 |
OAlg.Data.Variant
Contents
Description
concept of co- and contra.
Synopsis
- data Variant
- data Variant2 (v :: Variant) (h :: k -> k1 -> Type) (x :: k) (y :: k1) where
- Covariant2 :: forall {k} {k1} (h :: k -> k1 -> Type) (x :: k) (y :: k1). h x y -> Variant2 'Covariant h x y
- Contravariant2 :: forall {k} {k1} (h :: k -> k1 -> Type) (x :: k) (y :: k1). h x y -> Variant2 'Contravariant h x y
- toVariant2 :: Disjunctive2 h => h x y -> Either2 (Variant2 'Contravariant h) (Variant2 'Covariant h) x y
- vmap2 :: forall t (h :: Type -> Type -> Type) b (v :: Variant) x y. ApplicativeG t h b => Variant2 v h x y -> b (t x) (t y)
- amapVariant2 :: forall {k1} {k2} f (x :: k1) (y :: k2) g (v :: Variant). (f x y -> g x y) -> Variant2 v f x y -> Variant2 v g x y
- class Disjunctive x where
- class Disjunctive2 (h :: k -> k1 -> Type) where
- class (Category c, Disjunctive2 c) => CategoryDisjunctive (c :: Type -> Type -> Type)
- class CategoryDisjunctive h => CategoryDualisable (o :: Type -> Type) (h :: Type -> Type -> Type) where
- cToDual :: Struct (ObjectClass h) x -> Variant2 'Contravariant h x (o x)
- cFromDual :: Struct (ObjectClass h) x -> Variant2 'Contravariant h (o x) x
- vInv2 :: forall (c :: Type -> Type -> Type) (v :: Variant) x y. CategoryDisjunctive c => Variant2 v (Inv2 c) x y -> Variant2 v (Inv2 c) y x
- prpCategoryDisjunctive :: forall (c :: Type -> Type -> Type). (CategoryDisjunctive c, Show2 c) => X (SomeObjectClass c) -> X (SomeCmpb2 c) -> Statement
- prpCategoryDualisable :: forall (o :: Type -> Type) (h :: Type -> Type -> Type) q. (CategoryDualisable o h, EqExt h) => q o h -> X (SomeObjectClass h) -> Statement
Variant
concept of co- and contravariant.
Constructors
| Covariant | |
| Contravariant |
Instances
| Bounded Variant Source # | |
| Enum Variant Source # | |
| Read Variant Source # | |
| Show Variant Source # | |
| Eq Variant Source # | |
| Ord Variant Source # | |
| Validable Variant Source # | |
| Multiplicative Variant Source # | |
| Oriented Variant Source # | |
| EqPoint Variant Source # | |
Defined in OAlg.Data.Variant | |
| ShowPoint Variant Source # | |
Defined in OAlg.Data.Variant | |
| TypeablePoint Variant Source # | |
Defined in OAlg.Data.Variant | |
| ValidablePoint Variant Source # | |
Defined in OAlg.Data.Variant | |
| type Point Variant Source # | |
Defined in OAlg.Data.Variant | |
data Variant2 (v :: Variant) (h :: k -> k1 -> Type) (x :: k) (y :: k1) where Source #
concept of co- and contravariant for two parameterized types.
Constructors
| Covariant2 :: forall {k} {k1} (h :: k -> k1 -> Type) (x :: k) (y :: k1). h x y -> Variant2 'Covariant h x y | |
| Contravariant2 :: forall {k} {k1} (h :: k -> k1 -> Type) (x :: k) (y :: k1). h x y -> Variant2 'Contravariant h x y |
Instances
toVariant2 :: Disjunctive2 h => h x y -> Either2 (Variant2 'Contravariant h) (Variant2 'Covariant h) x y Source #
mapping to Variant2 for a .Disjunctive2 h
vmap2 :: forall t (h :: Type -> Type -> Type) b (v :: Variant) x y. ApplicativeG t h b => Variant2 v h x y -> b (t x) (t y) Source #
application on Variant2.
amapVariant2 :: forall {k1} {k2} f (x :: k1) (y :: k2) g (v :: Variant). (f x y -> g x y) -> Variant2 v f x y -> Variant2 v g x y Source #
mapping the Variant2 by preserving the variance.
Disjunctive
class Disjunctive x where Source #
object having an associated variant.
Instances
| Disjunctive2 h => Disjunctive (Path h x y) Source # | |
| Disjunctive (HomCo m s o x y) Source # | |
| Disjunctive (HomDisj s o h x y) Source # | |
| Disjunctive (SHom r s o h x y) Source # | |
| Disjunctive (SMorphism r s o h x y) Source # | |
class Disjunctive2 (h :: k -> k1 -> Type) where Source #
two parameterized object having a associated variant.
Minimal complete definition
Nothing
Methods
variant2 :: forall (x :: k) (y :: k1). h x y -> Variant Source #
default variant2 :: forall (x :: k) (y :: k1). Disjunctive (h x y) => h x y -> Variant Source #
Instances
| CategoryDisjunctive h => Disjunctive2 (Inv2 h :: Type -> Type -> Type) Source # | |
| Disjunctive2 h => Disjunctive2 (Path h :: Type -> Type -> Type) Source # | |
| Disjunctive2 h => Disjunctive2 (Sub s h :: Type -> Type -> Type) Source # | |
| Disjunctive2 (HomCo m s o :: Type -> Type -> Type) Source # | |
| Disjunctive2 (HomDisj s o h :: Type -> Type -> Type) Source # | |
| Disjunctive2 (SHom r s o h :: Type -> Type -> Type) Source # | |
| Disjunctive2 (SMorphism r s o h :: Type -> Type -> Type) Source # | |
| Disjunctive2 (Variant2 v h :: k1 -> k2 -> Type) Source # | |
class (Category c, Disjunctive2 c) => CategoryDisjunctive (c :: Type -> Type -> Type) Source #
disjunctive category.
Properties Let , then holds:CategoryDisjunctive c
Instances
| CategoryDisjunctive c => CategoryDisjunctive (Inv2 c) Source # | |
Defined in OAlg.Data.Variant | |
| (Morphism h, Disjunctive2 h) => CategoryDisjunctive (Path h) Source # | |
Defined in OAlg.Data.Variant | |
| (CategoryDisjunctive c, TransformableObjectClass s c) => CategoryDisjunctive (Sub s c) Source # | |
Defined in OAlg.Data.Variant | |
| CategoryDisjunctive (HomCo m s o) Source # | |
Defined in OAlg.Data.HomCo | |
| Morphism h => CategoryDisjunctive (HomDisj s o h) Source # | |
Defined in OAlg.Hom.Definition | |
| Morphism h => CategoryDisjunctive (SHom r s o h) Source # | |
Defined in OAlg.Category.SDuality | |
class CategoryDisjunctive h => CategoryDualisable (o :: Type -> Type) (h :: Type -> Type -> Type) where Source #
disjunctive category admitting duality morphisms.
Property Let , then for all CategoryDualisable o hx and s in
holds:Struct ('ObjectClass h) x
where and Contravariant2 t = cToDual s.Contravariant2 f = cFromDual s
Methods
cToDual :: Struct (ObjectClass h) x -> Variant2 'Contravariant h x (o x) Source #
cFromDual :: Struct (ObjectClass h) x -> Variant2 'Contravariant h (o x) x Source #
Instances
| (Morphism h, TransformableGRefl o s) => CategoryDualisable o (HomDisj s o h) Source # | |
Defined in OAlg.Hom.Definition Methods cToDual :: Struct (ObjectClass (HomDisj s o h)) x -> Variant2 'Contravariant (HomDisj s o h) x (o x) Source # cFromDual :: Struct (ObjectClass (HomDisj s o h)) x -> Variant2 'Contravariant (HomDisj s o h) (o x) x Source # | |
| (Morphism h, TransformableGRefl o s) => CategoryDualisable o (SHom r s o h) Source # | |
Defined in OAlg.Category.SDuality Methods cToDual :: Struct (ObjectClass (SHom r s o h)) x -> Variant2 'Contravariant (SHom r s o h) x (o x) Source # cFromDual :: Struct (ObjectClass (SHom r s o h)) x -> Variant2 'Contravariant (SHom r s o h) (o x) x Source # | |
vInv2 :: forall (c :: Type -> Type -> Type) (v :: Variant) x y. CategoryDisjunctive c => Variant2 v (Inv2 c) x y -> Variant2 v (Inv2 c) y x Source #
the inverse Variant2.
Proposition
prpCategoryDisjunctive :: forall (c :: Type -> Type -> Type). (CategoryDisjunctive c, Show2 c) => X (SomeObjectClass c) -> X (SomeCmpb2 c) -> Statement Source #
validity according to CategoryDisjunctive.
prpCategoryDualisable :: forall (o :: Type -> Type) (h :: Type -> Type -> Type) q. (CategoryDualisable o h, EqExt h) => q o h -> X (SomeObjectClass h) -> Statement Source #
validity according to CategoryDualisable.