Skip to content

Instantly share code, notes, and snippets.

@mmynsted
Last active December 25, 2015 21:59
Show Gist options
  • Save mmynsted/7046872 to your computer and use it in GitHub Desktop.
Save mmynsted/7046872 to your computer and use it in GitHub Desktop.
Functional Programming Glossary - please update/correct as needed

Glossary of Functional Programming Terms

Functor

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].

Associative expression

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

Commutative expression

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

Referentially transparent expression

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment