Category Theory for Functional Programming

Math Online Tom Circle

image

Key Motivations for Category Theory 范畴 :
1. Programming is Math.
2. Object-Oriented is based on Set Theory which has 2 weaknesses:
◇ Set has contradiction: The “Russell’s Paradox”.
Data Immutability for Concurrent Processing : OO can’t control the mutable state of objects, making debugging impossible.

Category (“cat“) has 3 properties:
1. Objects
eg. Set, List, Group, anything…
2. Arrows (“Morphism”, between Objects) which are Associative
eg. functions etc
3. Identity Object

Note: If the Identity is “0” or “Nothing”, then it is called Free Category.

Extensions :
1. “Cat” = Category of categories, is also a category.
2. Functor 函子 = Arrows between Categories.
3. Monoid = A Category with ONLY 1 Object.

image

image

Monoid (么半群) is a very powerful concept (used in Natural Language Processing) — basically it is a Group with No Inverse (Mo‘No‘-‘I‘-d)

image

image

View original post

Advertisements

About tomcircle

Math amateur
This entry was posted in math. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s