dublinjs - functional programming

19
FUNCTIONAL PROGRAMMING (AND THE WEB) BY @BOBJLONG

Upload: bobjlong

Post on 21-Jan-2018

279 views

Category:

Technology


0 download

TRANSCRIPT

F U N C T I O N A L P R O G R A M M I N G( A N D T H E W E B )

B Y @ B O B J L O N G

D AV I D H I L B E R T 1 8 3 2 - 1 9 4 3

E N T S C H E I D U N G S P R O B L E M ( D E C I S I O N P R O B L E M )

Gödel / Turing / Church

<expr> = <variable>

<expr> = (λ<identifier>.<expr>)

<expr> = (<expr><expr>)

λf.λx.x

λf.λx.f x

λf.λx.f (f x)

λf.λx.f (f (f x))

λn.λf.λx.f (n f x)

λn.λf.λx.f (n f x)

λf.λx.x <- 0

λf.λx.f x <- 1λn.λf.λx.f (n f x)

λn.λf.λx.f (n f x)

n = λf.λx.x

λf.λx.f (λf.λx.x f x)

λf.λx.f x

= 1

(let ((a 1)(b 2))

(+ b a))

((lambda (a b)

(+ b a)) 1 2)

T H I N G S W E C A R E A B O U T

immutability

declarative programming

concurrency/parallelism

correctness

immutability: avoids direct DOM mutation, + general immutable helpers

declarative: avoids imperative manipulation

correctness / performance: sum of parts

{ “name”: “Foo”, “position”: [-1, 30]}

C O N C L U S I O N S … Q U E S T I O N S ?

@ B O B J L O N G