A curried function takes a single argument and returns another function that takes the next argument until it can evaluate to a result.
According to wikipedia a functor is a type of mapping between categories arising in category theory.
To simplefy it, functors are objects, types, function that contain implementation of the map
function.
The map transforms contents of the functor.
- implementation of map function that transforms contents of the functor
map
always returns functors of the same type
There are two kinds of composition - object composition and function composition:
- object composition - way of combining simple objects into complex ones.
- function composition - way of combining simple functions to build more complicated ones.
It doesn't encourage developers to build large object heritage, so applications aren't complex like enterprise Java apps. We limit the future predition to minimum.
A pure function for given the same input will always return the same output and evaluation of this function will not cause any side effects.
- easy to test, as they always return the same value,
- easy to debug, as they shouldn't cause any race conditions and circular dependencies,
- simple and independent, as they don't cause any side effects (it makes design clean),
- easy to scale application up, as they shouldn't rely on machine state.
NewerOlder