FiniteCategories: Finite categories and usual categorical constructions on them.

[ data, gpl, library, maths ] [ Propose Tags ]

This package provides tools to create categories at the value level. This is different from the Hask category where types are objects in a category with infinite objects and arrows, here we construct categories where objects and arrows are arbitrary values so that we can change categories during runtime. Each category implements three functions following the category structure axioms : ob which returns objects of the category, ar which returns arrows between two objects of the category and identity which returns the identity of an object. Thanks to theses functions, we can construct automatically all the usual constructions on the categories (limits and colimits, adjunctions, Yoneda embedding, etc.) Functors are different from usual Functor typeclass, we store functors as mapping between objects and morphisms of two categories. This package is also different from the package data-category because we can enumerate objects and arrows in a category. This allows us to construct limit, colimits, adjunctions, etc. automatically for arbitrary finite categories. On the other hand, we loose typecheck at compilation time which ensures that composition is sound in Hask, composition in our package might lead to an error raised during runtime. See the Readme file for installation help.

Modules

[Index] [Quick Jump]

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0 CHANGELOG.md base (>=4.15.0.0 && <4.16), containers (>=0.6.4 && <0.7), directory (>=1.3.6 && <1.4), fgl (>=5.7.0 && <5.8), filepath (>=1.4.2 && <1.5), graphviz (>=2999.20.1 && <2999.21), process (>=1.6.11 && <1.7), random (>=1.2.1 && <1.3), text (>=1.2.4 && <1.3) [details] GPL-3.0-or-later Guillaume Sabbagh guillaumesabbagh@protonmail.com Data, Maths https://gitlab.utc.fr/gsabbagh/FiniteCategories by gsabbagh at 2022-03-28T13:51:10Z NixOS:0.1.0.0 36 total (5 in the last 30 days) (no votes yet) [estimated by Bayesian average] λ λ λ Docs uploaded by userBuild status unknown

[back to package description]

FiniteCategories

The goal of this project is to represent small finite categories in order to make usual constructions automatically on them (e.g. (co)limits, (co)completion, adjunctions, etc.)

General Info

This package provides tools to create categories at the value level. This is different from the Hask category where types are objects in a category with infinite objects and arrows, here we construct categories where objects and arrows are arbitrary values so that we can change categories during runtime. Each category implements three functions following the category structure axioms : ob which returns objects of the category, ar which returns arrows between two objects of the category and identity which returns the identity of an object. Thanks to theses functions, we can construct automatically all the usual constructions on the categories (limits and colimits, adjunctions, Yoneda embedding, etc.) Functors are different from usual Functor typeclass, we store functors as mapping between objects and morphisms of two categories.

This package is also different from the package data-category because we can enumerate objects and arrows in a category. This allows us to construct limit, colimits, adjunctions, etc. automatically for arbitrary finite categories. On the other hand, we loose typecheck at compilation time which ensures that composition is sound in Hask, composition in our package might lead to an error raised during runtime.

Technologies

The project uses GraphViz for visualizing the categories created.

There is another version programmed in Python : repository link

Installation

To use the graphviz exports, you must first install graphviz (see graphviz website) and make sure that Graphviz folder is in the path (dot should be a callable program from your terminal, if you are on Windows see this tutorial and if you are on unix see this tutorial).

Collaboration

All contributions are appreciated! Contact me by email for any information.

Usage

To run all examples of the project, run in a terminal the following command :

cabal test

You can then find the graphviz output in the folder OutputGraphViz/.

The first files you should inspect in the documentation are FiniteCategory.FiniteCategory and CompositionGraph.CompositionGraph. They are the most useful to understand and create new categories from scratch. You can also take a look at the examples in the test suite.

Examples

A category exported with graphviz looks like the following image :

A diagram on this category selecting two objects C and D is represented next :

A cone on this diagram follows, the apex of the cone is in green, its legs are in yellow and the diagram is in blue :

The limiting cone is represented below, it is the product of the two objects C and D.