Skip to content

Instantly share code, notes, and snippets.

@dbrack
Last active July 19, 2017 13:26
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dbrack/a7dc3dbd1e4ff8ed375f to your computer and use it in GitHub Desktop.
Save dbrack/a7dc3dbd1e4ff8ed375f to your computer and use it in GitHub Desktop.
Functors and higher order functions - definition

objects that implement map are functors. So, Array is a functor, and Array.filter is a higher order function

abstract

a functor is an object which acts as a container for a value, which then allows you to APPLY one or more functions to that value, and returns a new functor (in case of .map(), an Array) containing the transformed value.

See also here

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