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

Math.Categories.FinSet

Description

The FinSet category has finite sets as objects and functions as morphisms.

Finite sets are represented by weak sets from Data.WeakSet and functions by enriched weak maps from Data.WeakMap.

These structures are homogeneous, meaning you can only have sets containing one type of objects in a given FinSet category.

See the category PureSet for the category of sets which can be arbitrarily nested.

Synopsis

Function

data Function a Source #

A Function (finite function) is a weak map enriched with a codomain.

We have to store the codomain to retrieve the target set of a morphism in FinSet.

Constructors

Function 

Fields

Instances

Instances details
Eq a => Eq (Function a) Source # 
Instance details

Defined in Math.Categories.FinSet

Methods

(==) :: Function a -> Function a -> Bool

(/=) :: Function a -> Function a -> Bool

Show a => Show (Function a) Source # 
Instance details

Defined in Math.Categories.FinSet

Methods

showsPrec :: Int -> Function a -> ShowS

show :: Function a -> String

showList :: [Function a] -> ShowS

(PrettyPrint a, Eq a) => PrettyPrint (Function a) Source # 
Instance details

Defined in Math.Categories.FinSet

Methods

pprint :: Function a -> String Source #

Eq a => Morphism (Function a) (Set a) Source # 
Instance details

Defined in Math.Categories.FinSet

Methods

(@?) :: Function a -> Function a -> Maybe (Function a) Source #

source :: Function a -> Set a Source #

target :: Function a -> Set a Source #

Eq a => Category (FinSet a) (Function a) (Set a) Source # 
Instance details

Defined in Math.Categories.FinSet

Methods

identity :: FinSet a -> Set a -> Function a Source #

ar :: FinSet a -> Set a -> Set a -> Set (Function a) Source #

genAr :: FinSet a -> Set a -> Set a -> Set (Function a) Source #

decompose :: FinSet a -> Function a -> [Function a] Source #

(||!||) :: Eq a => Function a -> a -> a Source #

A function to apply a Function to an object in the domain of the Function.

FinSet

data FinSet a Source #

FinSet is the category of finite sets.

Constructors

FinSet 

Instances

Instances details
Eq (FinSet a) Source # 
Instance details

Defined in Math.Categories.FinSet

Methods

(==) :: FinSet a -> FinSet a -> Bool

(/=) :: FinSet a -> FinSet a -> Bool

Show (FinSet a) Source # 
Instance details

Defined in Math.Categories.FinSet

Methods

showsPrec :: Int -> FinSet a -> ShowS

show :: FinSet a -> String

showList :: [FinSet a] -> ShowS

(PrettyPrint a, Eq a) => PrettyPrint (FinSet a) Source # 
Instance details

Defined in Math.Categories.FinSet

Methods

pprint :: FinSet a -> String Source #

Eq a => Category (FinSet a) (Function a) (Set a) Source # 
Instance details

Defined in Math.Categories.FinSet

Methods

identity :: FinSet a -> Set a -> Function a Source #

ar :: FinSet a -> Set a -> Set a -> Set (Function a) Source #

genAr :: FinSet a -> Set a -> Set a -> Set (Function a) Source #

decompose :: FinSet a -> Function a -> [Function a] Source #