# 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.) ## Table of Contents 1. [General Info](#general-info) 2. [Technologies](#technologies) 3. [Installation](#installation) 4. [Collaboration](#collaboration) 5. [Examples](#examples) ## 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 an infinite number of 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 two functions following the category structure axioms : `ar` which returns arrows between two objects of the category and `identity` which returns the identity of an object. Each `FiniteCategory` implements an additional function : `ob` which returns the objects of the category. 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 which respect the category structure. 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 no longer maintained programmed in Python : [repository link](https://gitlab.utc.fr/gsabbagh/modification-de-categories) ## Installation To use the graphviz exports, you must first install graphviz (see [graphviz website](https://graphviz.org/download/)) 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](https://stackoverflow.com/questions/44272416/how-to-add-a-folder-to-path-environment-variable-in-windows-10-with-screensho#44272417) and if you are on unix see [this tutorial]( https://unix.stackexchange.com/questions/26047/how-to-correctly-add-a-path-to-path)). Then you can check the numerous examples provided to understand how to use the package. ## Collaboration All contributions are appreciated! Contact me by email for any information. ## Usage To run all examples of the project, clone the repository and run in a terminal from the repository the following command : ```cabal test``` You can then find the graphviz output in the folder `OutputGraphViz/`. ## Examples A category exported with graphviz looks like the following image : ![Category](https://gitlab.utc.fr/gsabbagh/FiniteCategories/-/raw/master/Images/ExampleCategory.png) A diagram on this category selecting two objects C and D is represented next : ![Diagram](https://gitlab.utc.fr/gsabbagh/FiniteCategories/-/raw/master/Images/ExampleDiagram.png) 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 : ![Cone](https://gitlab.utc.fr/gsabbagh/FiniteCategories/-/raw/master/Images/ExampleCone.png) The limiting cone is represented below, it is the product of the two objects C and D. ![Limit](https://gitlab.utc.fr/gsabbagh/FiniteCategories/-/raw/master/Images/ExampleLimit.png)