Free

Category Theory for Programmers

By Bartosz Milewski
Free
Book Description

For some time now I’ve been oating the idea of writing a book about category theory that would be targeted at programmers. Mind you, not computer scientists but pro- grammers — engineers rather than scientists. I know this sounds crazy and I am properly scared. I can’t deny that there is a huge gap between science and engineering be- cause I have worked on both sides of the divide. But I’ve al- ways felt a very strong compulsion to explain things. I have tremendous admiration for Richard Feynman who was the master of simple explanations. I know I’m no Feynman, but I will try my best. I’m starting by publishing this pref- ace — which is supposed to motivate the reader to learn category theory — in hopes of starting a discussion and soliciting feedback.

This is an unofficial PDF version of "Category Theory for Programmers" by Bartosz Milewski, converted from his blogpost series.

• Preface
• I Part One
• Category: The Essence of Composition
• Arrows as Functions
• Properties of Composition
• Composition is the Essence of Programming
• Challenges
• Types and Functions
• Who Needs Types?
• What Are Types?
• Why Do We Need a Mathematical Model?
• Pure and Dirty Functions
• Examples of Types
• Challenges
• Categories Great and Small
• No Objects
• Simple Graphs
• Orders
• Monoid as Set
• Monoid as Category
• Challenges
• Kleisli Categories
• The Writer Category
• Kleisli Categories
• Challenge
• Products and Coproducts
• Initial Object
• Terminal Object
• Duality
• Isomorphisms
• Products
• Coproduct
• Asymmetry
• Challenges
• Bibliography
• Simple Algebraic Data Types
• Product Types
• Records
• Sum Types
• Algebra of Types
• Challenges
• Functors
• Functors in Programming
• The Maybe Functor
• Equational Reasoning
• Optional
• Typeclasses
• Functor in C++
• The List Functor
• Functors as Containers
• Functor Composition
• Challenges
• Functoriality
• Bifunctors
• Product and Coproduct Bifunctors
• Functorial Algebraic Data Types
• Functors in C++
• The Writer Functor
• Covariant and Contravariant Functors
• Profunctors
• Challenges
• Function Types
• Universal Construction
• Currying
• Exponentials
• Cartesian Closed Categories
• Exponentials and Algebraic Data Types
• Zeroth Power
• Powers of One
• First Power
• Exponentials of Sums
• Exponentials of Exponentials
• Exponentials over Products
• Curry-Howard Isomorphism
• Bibliography
• Natural Transformations
• Polymorphic Functions
• Beyond Naturality
• Functor Category
• 2-Categories
• Conclusion
• Challenges
• II Part Two
• Declarative Programming
• Limits and Colimits
• Limit as a Natural Isomorphism
• Examples of Limits
• Colimits
• Continuity
• Challenges
• Free Monoids
• Free Monoid Universal Construction
• Challenges
• Representable Functors
• The Hom Functor
• Representable Functors
• Challenges
• Bibliography
• The Yoneda Lemma
• Co-Yoneda
• Challenges
• Bibliography
• Yoneda Embedding
• The Embedding
• Preorder Example
• Naturality
• Challenges
• III Part Three
• Functors
• Commuting Diagrams
• Natural Transformations
• Natural Isomorphisms
• Hom-Sets
• Hom-Set Isomorphisms
• Asymmetry of Hom-Sets
• Challenges
• Challenges
• Some Intuitions
• Challenges
• The Kleisli Category
• Fish Anatomy
• The do Notation
• The Problem
• The Solution
• Partiality
• Nondeterminism
• Write-Only State
• State
• Exceptions
• Continuations
• Interactive Input
• Interactive Output
• Conclusion
• Monoidal Categories
• Monoid in a Monoidal Category
• Dissecting the Composition
• Challenges
• F-Algebras
• Recursion
• Category of F-Algebras
• Natural Numbers
• Catamorphisms
• Folds
• Coalgebras
• Challenges
• T-algebras
• The Kleisli Category
• Lenses
• Challenges
• Ends and Coends
• Dinatural Transformations
• Ends
• Ends as Equalizers
• Natural Transformations as Ends
• Coends
• Ninja Yoneda Lemma
• Profunctor Composition
• Kan Extensions
• Right Kan Extension
• Left Kan Extension
• Kan Extensions as Ends
• Free Functor
• Enriched Categories
• Why Monoidal Category?
• Monoidal Category
• Enriched Category
• Preorders
• Metric Spaces
• Enriched Functors
• Self Enrichment
• Relation to 2-Categories
• Topoi
• Subobject Classifier
• Topos
• Topoi and Logic
• Challenges
• Lawvere Theories
• Universal Algebra
• Lavwere Theories
• Models of Lawvere Theories
• The Theory of Monoids
• Lawvere Theory of Side Effects
• Challenges
• Bicategories
• Challenges
• Bibliography
• Acknowledgments
• Index
• Colophon
• Copyleft notice
The book hasn't received reviews yet.
You May Also Like
Free
Learn OpenGL
By Joey de Vries
Free
Intermediate Python
Free
Reverse Engineering for Beginners
By Dennis Yurichev
Free
The Coder's Apprentice
By Pieter Spronck
Free
Sketchy LISP
By Nils M. Holm
Also Available On
Categories
Curated Lists
• Free Machine Learning Books

11 Books

Pattern Recognition and Machine Learning (Information Science and Statistics)
by Christopher M. Bishop
Data mining
by I. H. Witten
The Elements of Statistical Learning: Data Mining, Inference, and Prediction
by Various
See more...
• Free Chemistry Textbooks

8 Books

CK-12 Chemistry
by Various
by Free High School Science Texts Project
General Chemistry II
by John Hutchinson
See more...
• Free Mathematics Textbooks

21 Books

Microsoft Word - How to Use Advanced Algebra II.doc
by Jonathan Emmons
Advanced Algebra II: Activities and Homework
by Kenny Felder
de2de
by
See more...
• Free Children Books

38 Books

The Sun Who Lost His Way
by
Tania is a Detective
by Kanika G
Firenze_s-Light
by
See more...
• Free Java Books

10 Books

Java 3D Programming
by Daniel Selman
The Java EE 6 Tutorial
by Oracle Corporation
JavaKid811
by
See more...
• Sts Peter And Paul Preparatory School eBook List

8 Books

Jamaica Primary Social Studies 2nd Edition Student's Book 4
by Eulie Mantock, Trineta Fendall, Clare Eastland