A type constructor F[_]
together with an operation forall A, B. (A => B) => F[A] => F[B]
that satisfies FunctorLaw,
i.e. that a series of maps may be freely rewritten as a single map on a composed function, and that the identity function, lifted, is a no-op.
A good example from scalaz
def map[A, B](fa: F[A])(f: (A) ⇒ B): F[B]
Lift f
into F
and apply to F[A]
.
An expression containing two or more occurrences of the same operator in a persistent operand sequence, such that the order the like operations are performed does not alter the result.
An example would be addition where the following are equivalent.
(1 + 2) + 5 = 8
1 + (2 + 5) = 8
An expression comprised of one or more binary operations such that changing the order of the operands does not change the result.
And example would be multiplication.
3 * 5 = 15
5 * 3 = 15
An expression that can be replaced with its resulting value without changing the affect of the expression on the larger program. An expression that will consistently return the same output for a given input.