Functional Programming for the Rest of Us in Javascript
FP Concepts Higher Order Functions
Closure
Currying
Lazy Evaluation
Higher Order Functions Functions are First class objects

Functional Programming for the Rest of Us in Javascript

Editor's Notes

  • #2 *introduction* fp4us is an introduction to fp concepts using javascript which is inherently functional what is functional? fn as first class => fns as args, fns as returns rest of us? => rest of us who dont use the functional power of js or rest of us for whom fn languages are hard to grasp *benefits* (skip) Immutable => final in java, not in js, immutability in haskell, lisp Stateless -> Recursion, No side effects => Easy unit testing, Easy debugging Concurrency => parallelizable High availability
  • #4 HOF fns as args fns that return fn as args example using uppercase, lowercase Closure ex: delta in HOF example Other examples in currying
  • #5 Currying partial application of functions Haskell Curry analogy for curry - precooked js does not have currying built in but its easier to extend bcos fns are first class objects currying left is common in haskell currying right is possible in js Recursion ex: power in currying example
  • #6 Lazy evaluation: fun vs fun() in js fun vs (fun) in Lisp Infinite data structures Infinite sequence, fibonacci generator