how to not write a for loop and other stories ivan towlson mindscape

Post on 01-Apr-2015

219 Views

Category:

Documents

1 Downloads

Preview:

Click to see full reader

TRANSCRIPT

How to Not Write a For Loopand other stories

Ivan TowlsonMindscape

Erik Meijer

Confessions of a Used Programming Language Salesman

“Functional programming has finally reached the masses, except that it is calledVisual Basic 9 instead of Haskell 98.”

Mads Torgersen

Foreword to Petricek, Real World Functional Programming

“Functional programming is a state of mind.”

Free your mindand your programs will follow

with apologies to Funkadelic

It’s a functional world, Codemaniacs.Let’s go exploring!

with apologies to Bill Watterson

What is the value of a conditional?

Control constructs

What is the value of a for loop?

Control constructs

A

M

F

E

M F A

Generalising conditionals

Programming by cases

Statements expressions

Loops filter / map / expand / fold

Cases pattern matching

Imperative mind,functional mind

Statements expressions

Imperative mind,functional mind

What are the steps to carry out the calculation?

What is the value of the

calculation?

Statements expressions

Loops filter / map / expand / fold

Cases pattern matching

Imperative mind,functional mind

Composable

Self-documenting

Calling out similarities

Calling out differences

Imperative mind,functional mind

Petricek, “Real World Functional Programming in F# and C#” (Manning)

FSharpx project (GitHub)

Resources

Thanks!

Ivan Towlsonivan@mindscape.co.nzhttp://mindscapehq.com/blog/ivan@hestia.cchttp://hestia.typepad.com/flatlander/

top related