3 ms·
On the other hand, at least some of the ideas from the category theory have already made their way into the _practice_ of programming. I am talking about the no
by Koshkin 10y ago
On the other hand, at least some of the ideas from the category theory have already made their way into the _practice_ of programming. I am talking about the notion of a monad. It has already become an important tool in functional programming; but even in mostly-imperative programming languages such as C# one can discern important patterns as instances of this concept. Contrary to the common perception, it is not hard to understand. Two basic examples: the optional (a.k.a. nullable) type construct is an example of a monad (called 'Maybe' monad in Haskell); a generic list construct is another one. I think it is enlightening to be able to see a common pattern behind these, seemingly different, things. And this is exactly where the power and the usefulness of the category theory lies - in mathematics or elsewhere.
- dllthomas 10y ago> the optional (a.k.a. nullable) type construct is an example of a monad Nullable (in the C# sense) does not form a monad, because it does not form a functor, because you cannot write fmap, because it does not nest.