Functional Js Class
First Class Functions
Exercises
Loops
Imperative
    vs
Declarative
Exercises
Type Signatures
Type Signatures
• Tell you a “ton” about the function
• Very helpful when doing point free
• http://haskell.org/hoogle/
• http://ttic.uchicago.edu/~dreyer/course/
  papers/wadler.pdf (theorems for free)
• https://vimeo.com/28069495     (data driven dev)
Purity
What’s Impure
• Mutations
• References to things outside the function
• Side effects (logging, db, http, ui)
• Given the same argument, it can give
  different output
Pure Functions
• Portable
• Parallelizable
• Reusable
• Easily tested
• Easy to reason about
Partial Application
Curried Function

 “A function that takes one
    argument at a time”
Partial Application
• Build new functions
• “Freeze” state
• Make types “line up”
• Composition
Exercises
Composition
Category Theory

“The mathematical theory of function
          composition”



                          *inaccurate definition
Exercises
Composition
• Build new functions from other functions
• Declarative
• Mathematically backed
• Cornerstone of functional programs
Design
Review
• Loops
• First class functions
• Declarative vs Imperative
• Type signatures
• Purity
• Partial application
• Composition
• Module Design
Functional js class

Functional js class