-
22
pages
-
English
-
Documents
Description
Crash Course in Monads Vlad Patryshev Introduction Monads in programming seem to be the most mysterious notion of the century. I find two reasons for this: lack of familiarity with category theory; many authors carefully bypass any mention of categories. It's like talking about electricity without using calculus. Good enough to replace a fuse, not good enough to design an amplifier. This crash course starts with an easy introduction to categories and functors, then we define a monad, then give some basic examples of monads in categories, then present monadic terminology as used in programming languages. I am sure that if you approach the topic from categorical point of view, everything will look almost elementary. Vlad Patryshev, 3/7/2006 - 2/12/2007 Category A category consists of objects and morphisms between objects. The term "morphism" is a little bit misleading (they are not required to morph anything); so morphisms are frequently called "arrows", to stress their abstract nature. I'll use the term "arrow" except when an arrow represent some kind of function, in which case I'll call it a "morphism". But it's still just an arrow to me. We do not care about the nature of object and arrows; all we need are the following properties: An arrow starts at an object and ends at another (may be the same object); this is denoted in the following way: f: a → b, where f is an ...
-
Publié par
-
Langue
English