You can understand Monad without too much Category Theory.
Functional Programming = using functions to compose from small functions to very complex software (eg. Nuclear system, driverless car software…).
Advantages of Functional Programming:
- Strong Types Safety: detect bugs at compile time.
- Data Protection thru Immutability: Share data safely in Concurrent / Parallel processing.
- Software ‘Componentisation’ ie Modularity: Each function always returns the same result, ease of software reliability testing.
Each “small” function is a Monoid.
f : a -> a (from input of type ‘a‘ , returns type ‘a’)
g: a -> a
compose h from f & g : (strong TYPING !!)
h = f。g : a -> a
[Note]: Object in Category, usually called Type in Haskell, eg.’a’ = Integer)
You already know a Monoid (or Category in general) : eg Clock
- Objects: 1 2 3 …12 (hours)
View original post 185 more words