Skip to content

Instantly share code, notes, and snippets.

@ivankisyov
Last active December 30, 2018 22:17
Show Gist options
  • Save ivankisyov/37b4d88a3b6ee81bae342f2ccccd3882 to your computer and use it in GitHub Desktop.
Save ivankisyov/37b4d88a3b6ee81bae342f2ccccd3882 to your computer and use it in GitHub Desktop.
Functional Programming

Functional Programming

Pure Functions

  • a fn which uses only its arguments and/or local variables to compute its result
  • a fn which does not cause side effects

Todo: Function Composition

Higher Order Function

A function which can:

  • take another function as an argument
  • return another function as a result

First class functions, functions as first-class citizens

Functions are objects. You can pass them around.

Recursion

Core principle: take the big problem and divide it into smaller instances of the same problem

Requirements

  • Base case: You need to make sure that you understand and define a condition in which the function is no longer invoked recursively and instead a value is returned

Articles

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