Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Category Theory #21

Open
wangbinyq opened this issue Sep 15, 2017 · 0 comments
Open

Category Theory #21

wangbinyq opened this issue Sep 15, 2017 · 0 comments
Labels

Comments

@wangbinyq
Copy link
Owner

wangbinyq commented Sep 15, 2017

https://bartoszmilewski.com/2014/10/28/category-theory-for-programmers-the-preface/

Category: The Essence of Composition

A category consists of objects and arrows that go between them.
But the essence of a category is composition.
f . g = \x -> f(g(x))

Their surface area has to increase slower than their volume.
An object in category theory is an abstract nebulous entity. All you can ever know about it is how it relates to other object — how it connects with them using arrows.

Types and Functions

Types Are About Composability.

Set

Types are sets of values.
The great thing is that there is a category of sets, which is called Set.
In Set, objects are sets and morphisms (arrows) are functions.
In Haskell, every type have one special value called the bottom (undefined), It deals halting problem.
Functions that may return bottom are called partial, as opposed to total functions, which return valid results for every possible argument.

Hask

Because of the bottom, you’ll see the category of Haskell types and functions referred to as Hask rather than Set.

operational semantics: a formalized idealized interpreter
denotational semantics: mathematical interpretation

Pure and Dirty Functions

Categories Great and Small

Zero categories: with zero objects and zero morphisms.
Free category: any directed graph by adding more arrows. 1. identity arrow, 2. composition arrow.
Preorder category: there is at most one morphism going from any object a to any object b.

A set of morphisms from object a to object b in a category C is called a hom-set and is written as C(a, b) .

Monoid as Set

A monoid is defined as a set with a associative binary operation and an unit element.

Monoid as Category

A monoid is a single object category.

@wangbinyq wangbinyq added the note label Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant