Libcat
C++ Category Theory
Install / Use
/learn @CatalinMihaiGhita/LibcatREADME
Welcome to libCat
This is a C++17 library which implements concepts from the Category Theory. The C++ standard library partialy does this, but we put it in a different view. The main objective is to enforce the programmer to write correct code, with lesser undefined behaviour.
Algebraic Types
Product types
The tuple type: (A, B, ...)
tup<A, B, ...>
The unit type ()
unit = tup<>
The unit type singletone
nil
Sum types
The variant type: A | B | ...
var<A, B, ...>
The zero type
nvr = var<>
Memory Management Types
A unique_ptr<A> equivalent, but never nullptr
box<A>
A shared_ptr<A> equivalent, but never nullptr
rc<A>
Memory management of A with a linked list
link<A>
Monad Types
The optional type: A | unit
opt<A> = var<A, unit>
The lazy type: A | nvr
lazy<A> = var<A, nvr>
The vector type (A, ...) | unit
vec<A>
Monad Types + Memory Management Types
The unique_ptr equivalent: box<A> | unit
opt<box<A>>
The weak_ptr equivalent: rc<A> | unit
opt<rc<A>>
