![Page 1: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/1.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/2.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/3.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/4.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/5.jpg)
![Page 6: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/6.jpg)
![Page 7: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/7.jpg)
![Page 8: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/8.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/9.jpg)
What is the value of a conditional?
Control constructs
![Page 10: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/10.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/11.jpg)
A
![Page 12: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/12.jpg)
M
![Page 13: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/13.jpg)
F
![Page 14: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/14.jpg)
E
![Page 15: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/15.jpg)
M F A
![Page 16: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/16.jpg)
Generalising conditionals
Programming by cases
![Page 17: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/17.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/18.jpg)
Statements expressions
Imperative mind,functional mind
![Page 19: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/19.jpg)
What are the steps to carry out the calculation?
![Page 20: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/20.jpg)
What is the value of the
calculation?
![Page 21: How to Not Write a For Loop and other stories Ivan Towlson Mindscape](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/21.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/22.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/23.jpg)
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](https://reader035.vdocuments.site/reader035/viewer/2022062404/551b5cf8550346dd1a8b6539/html5/thumbnails/24.jpg)
Thanks!
Ivan [email protected]://mindscapehq.com/blog/[email protected]://hestia.typepad.com/flatlander/