24
How to Not Write a For Loop and other stories Ivan Towlson Mindscape

How to Not Write a For Loop and other stories Ivan Towlson Mindscape

Embed Size (px)

Citation preview

Page 1: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

How to Not Write a For Loopand other stories

Ivan TowlsonMindscape

Page 2: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

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.”

Page 3: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

Mads Torgersen

Foreword to Petricek, Real World Functional Programming

“Functional programming is a state of mind.”

Page 4: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

Free your mindand your programs will follow

with apologies to Funkadelic

Page 5: How to Not Write a For Loop and other stories Ivan Towlson Mindscape
Page 6: How to Not Write a For Loop and other stories Ivan Towlson Mindscape
Page 7: How to Not Write a For Loop and other stories Ivan Towlson Mindscape
Page 8: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

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

with apologies to Bill Watterson

Page 9: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

What is the value of a conditional?

Control constructs

Page 10: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

What is the value of a for loop?

Control constructs

Page 11: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

A

Page 12: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

M

Page 13: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

F

Page 14: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

E

Page 15: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

M F A

Page 16: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

Generalising conditionals

Programming by cases

Page 17: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

Statements expressions

Loops filter / map / expand / fold

Cases pattern matching

Imperative mind,functional mind

Page 18: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

Statements expressions

Imperative mind,functional mind

Page 19: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

What are the steps to carry out the calculation?

Page 20: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

What is the value of the

calculation?

Page 21: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

Statements expressions

Loops filter / map / expand / fold

Cases pattern matching

Imperative mind,functional mind

Page 22: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

Composable

Self-documenting

Calling out similarities

Calling out differences

Imperative mind,functional mind

Page 23: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

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

FSharpx project (GitHub)

Resources

Page 24: How to Not Write a For Loop and other stories Ivan Towlson Mindscape

Thanks!

Ivan [email protected]://mindscapehq.com/blog/[email protected]://hestia.typepad.com/flatlander/