- What is a functor?
A functor defines data, accepts a function, and returns a transformation of the data.
- What is a contravariant functor?
A contravariant functor is a functor where the accepted function may produce 0, 1, or many return values. By comparison, functor's accepted functions must return exactly 1 value.
- What is a monad?
A monad, parameterized by a single type A, is a value that has a trait exposing two operations, usually named return and bind. return is a function that constructs a new monad<A> from a provided A value. bind should incorporate new information to produce a related but separate monad<B>.
- What are the monad laws?
These equivalencies must hold for strict monads. The three horizontal bars means equivalence:
_return(v).bind(f) ≡ f(v)
m.bind(_return) ≡ m
m.bind(f).bind(g) ≡ (|x| f(x).bind...