FiniteCategories-0.6.4.0: Finite categories and usual categorical constructions on them.
CopyrightGuillaume Sabbagh 2022
LicenseGPL-3
Maintainerguillaumesabbagh@protonmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe-Inferred
LanguageHaskell2010

Math.FiniteCategoryError

Description

Provide a function to test the structure of a FiniteCategory.

Synopsis

Check structure

data FiniteCategoryError m o Source #

A data type to represent an incoherence inside a finite category.

Instances

Instances details
(PrettyPrint m, PrettyPrint o) => PrettyPrint (FiniteCategoryError m o) Source # 
Instance details

Defined in Math.FiniteCategoryError

Methods

pprint :: Int -> FiniteCategoryError m o -> String Source #

pprintWithIndentations :: Int -> Int -> String -> FiniteCategoryError m o -> String Source #

pprintIndent :: Int -> FiniteCategoryError m o -> String Source #

(Simplifiable m, Simplifiable o) => Simplifiable (FiniteCategoryError m o) Source # 
Instance details

Defined in Math.FiniteCategoryError

Generic (FiniteCategoryError m o) Source # 
Instance details

Defined in Math.FiniteCategoryError

Associated Types

type Rep (FiniteCategoryError m o) :: Type -> Type

Methods

from :: FiniteCategoryError m o -> Rep (FiniteCategoryError m o) x

to :: Rep (FiniteCategoryError m o) x -> FiniteCategoryError m o

(Show o, Show m) => Show (FiniteCategoryError m o) Source # 
Instance details

Defined in Math.FiniteCategoryError

Methods

showsPrec :: Int -> FiniteCategoryError m o -> ShowS

show :: FiniteCategoryError m o -> String

showList :: [FiniteCategoryError m o] -> ShowS

(Eq o, Eq m) => Eq (FiniteCategoryError m o) Source # 
Instance details

Defined in Math.FiniteCategoryError

type Rep (FiniteCategoryError m o) Source # 
Instance details

Defined in Math.FiniteCategoryError

type Rep (FiniteCategoryError m o) = D1 ('MetaData "FiniteCategoryError" "Math.FiniteCategoryError" "FiniteCategories-0.6.4.0-inplace" 'False) (((C1 ('MetaCons "CompositionNotAssociative" 'PrefixI 'True) ((S1 ('MetaSel ('Just "f") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: S1 ('MetaSel ('Just "g") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m)) :*: (S1 ('MetaSel ('Just "h") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: (S1 ('MetaSel ('Just "fg_h") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: S1 ('MetaSel ('Just "f_gh") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m)))) :+: C1 ('MetaCons "WrongSource" 'PrefixI 'True) (S1 ('MetaSel ('Just "f") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: S1 ('MetaSel ('Just "realSource") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 o))) :+: (C1 ('MetaCons "WrongTarget" 'PrefixI 'True) (S1 ('MetaSel ('Just "f") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: S1 ('MetaSel ('Just "realTarget") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 o)) :+: (C1 ('MetaCons "IdentityNotLeftNeutral" 'PrefixI 'True) (S1 ('MetaSel ('Just "idL") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: (S1 ('MetaSel ('Just "f") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: S1 ('MetaSel ('Just "foidL") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m))) :+: C1 ('MetaCons "IdentityNotRightNeutral" 'PrefixI 'True) (S1 ('MetaSel ('Just "f") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: (S1 ('MetaSel ('Just "idR") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: S1 ('MetaSel ('Just "idRof") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m)))))) :+: ((C1 ('MetaCons "MorphismsShouldNotBeEqual" 'PrefixI 'True) (S1 ('MetaSel ('Just "f") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: S1 ('MetaSel ('Just "g") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m)) :+: C1 ('MetaCons "NotTransitive" 'PrefixI 'True) (S1 ('MetaSel ('Just "f") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: S1 ('MetaSel ('Just "g") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m))) :+: (C1 ('MetaCons "GeneratorIsNotAMorphism" 'PrefixI 'True) (S1 ('MetaSel ('Just "f") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m)) :+: (C1 ('MetaCons "MorphismDoesntDecomposesIntoGenerators" 'PrefixI 'True) (S1 ('MetaSel ('Just "f") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: (S1 ('MetaSel ('Just "decomp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [m]) :*: S1 ('MetaSel ('Just "notGen") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m))) :+: C1 ('MetaCons "WrongDecomposition" 'PrefixI 'True) (S1 ('MetaSel ('Just "f") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m) :*: (S1 ('MetaSel ('Just "decomp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 [m]) :*: S1 ('MetaSel ('Just "comp") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 m)))))))

checkFiniteCategory :: (FiniteCategory c m o, Morphism m o, Eq m, Eq o) => c -> Maybe (FiniteCategoryError m o) Source #

Checks the category axioms for a FiniteCategory.

If an error is found in the category, Just a FiniteCategoryError is returned. Otherwise, Nothing is returned.