SlideShare a Scribd company logo
1 of 115
Download to read offline
Hiking through the
Functional Forest with
FizzBuzz
Mike Harris | @MikeMKH | comp-phil.blogspot.com
The Functional Forest and Object Oriented City
The Functional Forest and Object Oriented City
let itinerary n =
match n with
| 0 -> "Rules"
| 1 -> "Pattern Matching"
| 2 -> "Types"
| 3 -> "Higher Order Functions"
| _ -> "Farewell"
// val itinerary : n:int -> string




let itinerary n =
match n with
| 0 -> "Rules"
| 1 -> "Pattern Matching"
| 2 -> "Types"
| 3 -> "Higher Order Functions"
| _ -> "Farewell"
itinerary 0
// val it : string = 

“Rules"
FizzBuzz
number FizzBuzzer text
int int -> string string
Rules
• x | 3 and x | 5 => FizzBuzz
• x | 3 => Fizz
• x | 5 => Buzz
• x => string x
Rules
• x | 3 and x | 5 => FizzBuzz
• x | 3 => Fizz
• x | 5 => Buzz
• x => string x
Specific
General
2 FizzBuzzer 2
x
33 FizzBuzzer Fizz
x | 3
55 FizzBuzzer Buzz
x | 5
45 FizzBuzzer FizzBuzz
x | 3
Conditional
x
Fizz

Buzz
Fizz
Buzz
x | 15
x | 3
x | 5
xelse
Specific
General
2
x | 15
x | 3
x | 5
2else
33
Fizz
x | 15
x | 3
x | 5
else
55
Buzz
x | 15
x | 3
x | 5
else
45
x | 15
x | 3
x | 5
else
Fizz

Buzz
x
Fizz

Buzz
Fizz
Buzz
x | 15
x | 3
x | 5
xelse
let fizzbuzzer x =
if x % 15 = 0 then "FizzBuzz"
elif x % 3 = 0 then "Fizz"
elif x % 5 = 0 then "Buzz"
else string x
Conditional
F#
let itinerary n =
match n with
| 0 -> "Rules"
| 1 -> "Pattern Matching"
| 2 -> "Types"
| 3 -> "Higher Order Functions"
| _ -> "Farewell"
itinerary 1
// val it : string = 

“Pattern Matching"
— ⽼老⼦子 trans. James Legge,

道德經, 64
“The journey of a thousand li commences with
a single step.”
Pattern Match
x
Fizz

Buzz
Fizz
Buzz
x | 15
x | 3
x | 5
x_
Specific
General
let fizzbuzzer x =
match x with
| x when x % 15 = 0 ->

"FizzBuzz"

| x when x % 3 = 0 ->
"Fizz"

| x when x % 5 = 0 ->
"Buzz"

| _ ->
string x
Pattern Match
F#
Pattern Match with Tuples
x | 3,

x | 5
Fizz

Buzz
Fizz
Buzz
0, 0
0, _
_, 0
x_
Specific
General
let fizzbuzzer x =
match x % 3, x % 5 with
| 0, 0 -> "FizzBuzz"
| 0, _ -> "Fizz"
| _, 0 -> "Buzz"
| _ -> string x
Pattern Match

with Tuples
F#
x | 3 = 0,

x | 5 = 0
Fizz

Buzz
Fizz
Buzz
T, T
T, F
F, T
xF, F
x | 3 = 0,

x | 5 = 0
x
Buzz
Fizz
F, F
F, T
T, F
Fizz

BuzzT, T
let fizzbuzzer x =
match x % 3 = 0, x % 5 = 0 with
| false, false -> string x
| false, true -> "Buzz"
| true, false -> "Fizz"
| true, true -> "FizzBuzz"
Pattern Match

with Tuples
F#
let itinerary n =
match n with
| 0 -> "Rules"
| 1 -> "Pattern Matching"
| 2 -> "Types"
| 3 -> "Higher Order Functions"
| _ -> "Farewell"
itinerary 2
// val it : string = 

“Types"
Discriminated Unions

aka Sum Type
value π
type 1
type 2
type 3
type n
int
Fizz

Buzz
Fizz
Buzz
Other

int
fizzbuzzer
45 fizzbuzzer
Fizz

Buzz
33 fizzbuzzer Fizz
55 fizzbuzzer Buzz
2 fizzbuzzer Other

2
type FizzBuzzer =
| FizzBuzz
| Fizz
| Buzz
| Other of int
let fizzbuzzing x =
match x % 3 = 0, x % 5 = 0 with
| true, true -> FizzBuzz
| true, false -> Fizz
| false, true -> Buzz
| false, false -> Other(x)
let fizzbuzzer x =
match fizzbuzzing x with
| FizzBuzz -> "FizzBuzz"
| Fizz -> "Fizz"
| Buzz -> "Buzz"
| Other(x) -> string x
Discriminated

Union
F#
type FizzBuzzer =
| FizzBuzz
| Fizz
| Buzz
| Other of int
…
Discriminated

Union
F#
type FizzBuzzer =
| FizzBuzz
| Fizz
| Buzz
| Other of int
let fizzbuzzing x =
match x % 3 = 0, x % 5 = 0 with
| true, true -> FizzBuzz
| true, false -> Fizz
| false, true -> Buzz
| false, false -> Other(x)
… Discriminated

Union
F#
…
let fizzbuzzing x =
match x % 3 = 0, x % 5 = 0 with
| true, true -> FizzBuzz
| true, false -> Fizz
| false, true -> Buzz
| false, false -> Other(x)
let fizzbuzzer x =
match fizzbuzzing x with
| FizzBuzz -> "FizzBuzz"
| Fizz -> "Fizz"
| Buzz -> "Buzz"
| Other(x) -> string x Discriminated

Union
F#
…
let fizzbuzzer x =
match fizzbuzzing x with
| FizzBuzz -> "FizzBuzz"
| Fizz -> "Fizz"
| Buzz -> "Buzz"
| Other(x) -> string x
Discriminated

Union
F#
type FizzBuzzer =
| FizzBuzz
| Fizz
| Buzz
| Other of int
let fizzbuzzing x =
match x % 3 = 0, x % 5 = 0 with
| true, true -> FizzBuzz
| true, false -> Fizz
| false, true -> Buzz
| false, false -> Other(x)
let fizzbuzzer x =
match fizzbuzzing x with
| FizzBuzz -> "FizzBuzz"
| Fizz -> "Fizz"
| Buzz -> "Buzz"
| Other(x) -> string x
Discriminated

Union
F#
Complete Active Pattern
value anonymous
type 1
type 2
type 3
type n
int anonymous
Fizz

Buzz
Fizz
Buzz
Other

int
45 anonymous
Fizz

Buzz
33 anonymous Fizz
55 anonymous Buzz
2 anonymous
Other

2
let (|FizzBuzz|Fizz|Buzz|Other|) x =
match x % 3 = 0, x % 5 = 0 with
| true, true -> FizzBuzz
| true, false -> Fizz
| false, true -> Buzz
| false, false -> Other(x)
let fizzbuzzer x =
match x with
| FizzBuzz -> "FizzBuzz"
| Fizz -> "Fizz"
| Buzz -> "Buzz"
| Other(x) -> string x Complete

Active Pattern
F#
let (|FizzBuzz|Fizz|Buzz|Other|) x =
match x % 3 = 0, x % 5 = 0 with
| true, true -> FizzBuzz
| true, false -> Fizz
| false, true -> Buzz
| false, false -> Other(x)
…
Complete

Active Pattern
F#
…
let fizzbuzzer x =
match x with
| FizzBuzz -> "FizzBuzz"
| Fizz -> "Fizz"
| Buzz -> "Buzz"
| Other(x) -> string x
Complete

Active Pattern
F#
let (|FizzBuzz|Fizz|Buzz|Other|) x =
match x % 3 = 0, x % 5 = 0 with
| true, true -> FizzBuzz
| true, false -> Fizz
| false, true -> Buzz
| false, false -> Other(x)
let fizzbuzzer x =
match x with
| FizzBuzz -> "FizzBuzz"
| Fizz -> "Fizz"
| Buzz -> "Buzz"
| Other(x) -> string x Complete

Active Pattern
F#
Partial Active Pattern
value anonymous
Some
None
33 divisible by Some
3
2 divisible by None
3
let (|DivisibleBy|_|) divisor x =
if x % divisor = 0
then Some ()
else None
let fizzbuzzer x =
match x with
| DivisibleBy 3 &
DivisibleBy 5 -> "FizzBuzz"
| DivisibleBy 3 -> "Fizz"
| DivisibleBy 5 -> "Buzz"
| _ -> string x Partial

Active Pattern
F#
let (|DivisibleBy|_|) divisor x =
if x % divisor = 0
then Some ()
else None
…
Partial

Active Pattern
F#
…
let fizzbuzzer x =
match x with
| DivisibleBy 3 &
DivisibleBy 5 -> “FizzBuzz"
| DivisibleBy 3 -> “Fizz"
| DivisibleBy 5 -> “Buzz"
| _ -> string x
Partial

Active Pattern
F#
let (|DivisibleBy|_|) divisor x =
if x % divisor = 0
then Some ()
else None
let fizzbuzzer x =
match x with
| DivisibleBy 3 &
DivisibleBy 5 -> "FizzBuzz"
| DivisibleBy 3 -> "Fizz"
| DivisibleBy 5 -> "Buzz"
| _ -> string x Partial

Active Pattern
F#
let itinerary n =
match n with
| 0 -> "Rules"
| 1 -> "Pattern Matching"
| 2 -> "Types"
| 3 -> "Higher Order Functions"
| _ -> "Farewell"
itinerary 3
// val it : string = 

“Higher Order Functions"
Fold
statefunction value 1
value 2
value n
statefunction value 2
value 3
value n
statefunction value 3
value 4
statefunction value 4
resultfunction
0+ 1
2
3
1+ 2
3
4
3+ 3
4
6+ 4
10+
“”m f -> m ++ f x
x | 3 ?
Fizz : “”
x | 5 ?
Buzz : “”
“”m f -> m ++ f 3
3 | 3 ?
Fizz : “”
x | 5 ?
Buzz : “”
Fizzm f -> m ++ f 3
3 | 5 ?
Buzz : “”
“Fizz”:“”
Fizzm f -> m ++ f 3
“Buzz”:“”
“”m f -> m ++ f 15
15 | 3 ?
Fizz : “”
x | 5 ?
Buzz : “”
Fizzm f -> m ++ f 15
15 | 5 ?
Buzz : “”
“Fizz”:“”
Fizz

Buzz
m f -> m ++ f 15
“Buzz”:“”
let fizzbuzzer x =
let rule d s =
(fun x -> if x % d = 0
then s
else "")
[rule 3 "Fizz";
rule 5 "Buzz"]
|> List.fold
(fun m f -> m + f x)
""
|> (fun s -> if s = ""
then string x
else s)Fold
F#
…
let rule d s =
(fun x -> if x % d = 0
then s
else "")
…
Fold
F#
…
let rule d s =
(fun x -> if x % d = 0
then s
else "")
[rule 3 "Fizz";
rule 5 "Buzz"]
…
Fold
F#
…
[rule 3 "Fizz";
rule 5 "Buzz"]
…
Fold
F#
…
[rule 3 "Fizz";
rule 5 "Buzz"]
|> List.fold
(fun m f -> m + f x)
""
…
Fold
F#
…
|> (fun s -> if s = ""
then string x
else s)
Fold
F#
let fizzbuzzer x =
let rule d s =
(fun x -> if x % d = 0
then s
else "")
[rule 3 "Fizz";
rule 5 "Buzz"]
|> List.fold
(fun m f -> m + f x)
""
|> (fun s -> if s = ""
then string x
else s)Fold
F#
Zip
function
result i
result ii
result iii
result p
value 1
value 2
value 3
value n
value a
value b
value c
value m
+
11
22
1
2
10
20
++
Fizz

Buzz
“”
“”
Fizz
Fizz
“”
“”
Fizz
Buzz
“”
“”
“”
let fizzbuzzer x =
let rec fizz =
seq { yield "Fizz";
yield ""; yield "";
yield! fizz }
let rec buzz =
seq { yield "Buzz";
yield ""; yield "";
yield ""; yield "";
yield! buzz }
Seq.map2 (+) fizz buzz
|> Seq.item (abs x)
|> (fun s -> if s = ""
then string x
else s)
Zip
F#
…
let rec fizz =
seq { yield "Fizz";
yield ""; yield "";
yield! fizz }
let rec buzz =
seq { yield "Buzz";
yield ""; yield "";
yield ""; yield "";
yield! buzz }
…
Zip
F#
…
Seq.map2 (+) fizz buzz
…
Zip
F#
…
Seq.map2 (+) fizz buzz
|> Seq.item (abs x)
…
Zip
F#
…
Seq.map2 (+) fizz buzz
|> Seq.item (abs x)
|> (fun s -> if s = ""
then string x
else s)
Zip
F#
let fizzbuzzer x =
let rec fizz =
seq { yield "Fizz";
yield ""; yield "";
yield! fizz }
let rec buzz =
seq { yield "Buzz";
yield ""; yield "";
yield ""; yield "";
yield! buzz }
Seq.map2 (+) fizz buzz
|> Seq.item (abs x)
|> (fun s -> if s = ""
then string x
else s)
Zip
F#
let itinerary n =
match n with
| 0 -> "Rules"
| 1 -> "Pattern Matching"
| 2 -> "Types"
| 3 -> "Higher Order Functions"
| _ -> "Farewell"
itinerary 4
// val it : string = 

“Farewell"
— Friedrich Nietzsche trans. R.J. Hollingdale,

Human, All Too Human, “The Wanderer and His Shadow”, 324
“How can anyone become a thinker if he does
not spend at least a third of the day without
passions, people, and books?”
Thank you!
Mike Harris



@MikeMKH

http://comp-phil.blogspot.com/
Images
• Klamath National Forest, NFS road 16N05 about 8 miles South of Happy Camp, California.
Taken by Erik Wheaton, http://www.burningwell.org/gallery2/v/Landscapes/forrests/
16N05_March_05.jpg.html
• View of São Paulo city from Núcleo Pedra Grande in Cantareira State Park. From https://
commons.wikimedia.org/wiki/File:Vista_de_s%C3%A3o_paulo_cantareira.jpg
• Centro de São Paulo, Brasil. Taken by Ana Paula Hirama, https://commons.wikimedia.org/wiki/
File:Centro_SP2.jpg
• F# logomark, by Unknown at the source. Fair use, https://en.wikipedia.org/w/index.php?
curid=44014320
• Lao-Tzu, by Lawrencekhoo - http://www.eng.taoism.org.hk/daoist-beliefs/immortals&immortalism/,
Public Domain, https://commons.wikimedia.org/w/index.php?curid=3991827
• Friedrich Nietzsche, by Unknown - http://ora-web.swkk.de/nie_brief_online/nietzsche.digitalisate?
id=234&nr=1, Public Domain, https://commons.wikimedia.org/w/index.php?curid=95964
• Me at StrangeLoop 2014. Taken by Kelsey Harris.
Source Code
• Conditional

https://gist.github.com/MikeMKH/9866f9923fa4dfa140e6
• Pattern Matching

https://gist.github.com/MikeMKH/
3fe93b2feea575f075fc54aecff2f01c
• Pattern Matching with Tuple

https://gist.github.com/MikeMKH/9b35eb70ffdbcb605efa
• Pattern Matching with Tuple using True / False

https://gist.github.com/MikeMKH/
f0d7f21554500ffc4de60d6acefca4a5
Source Code
• Discriminated Union

https://gist.github.com/MikeMKH/
05d95775276744c304d2e4e253960aba
• Complete Active Pattern

https://gist.github.com/MikeMKH/
15a837dbb24053320abb
• Partial Active Pattern

https://gist.github.com/MikeMKH/
a38be4d25641980a8dda
Source Code
• Fold

https://gist.github.com/MikeMKH/
39dbbc94d963df436c62
• Zip

https://gist.github.com/MikeMKH/
c107d578d727ba514d05fc8bfa078bb7
Books
• Brandewinder, Mathias. Machine learning projects for .NET
Developers. Berkeley, CA New York, NY: Apress, 2015. Print.
• Fancher, Dave. The book of F♯ : breaking free with managed
functional programming. San Francisco: No Starch Press, 2014.
Print.
• Lipovača, Miran. Learn you a Haskell for great good! a beginner's
guide. San Francisco, Calif: No Starch Press, 2011. Print.
• Michaelson, Greg. An introduction to functional programming
through Lambda calculus. Mineola, N.Y: Dover Publications,
2011. Print.
Websites
• Wlaschin, Scoot. F# for Fun and Profit. Web. 16 May
2016. <https://fsharpforfunandprofit.com/>.
• Seemann, Mark. ploeh blog. Web. 16 May 2016. <
http://blog.ploeh.dk/ >.
Papers
• Emir, Burak, Odersky, Martin and Williams, John. Matching
Objects With Patterns. LAMP-REPORT-2006-006.
• Hutton, Graham. A tutorial on the universality and
expressiveness of fold. J. Functional Programming, 9 (4):
355–372, July 1999.
• Petricek, Tomas and Syme, Don. The F# Computation
Expression Zoo. Proceedings of Practical Aspects of
Declarative Languages, PADL 2014. San Diego, CA, USA.
• Wadler, Philip. Views︎: A way for pattern matching to cohabit
with data abstraction. March ︎︎︎︎1987.

More Related Content

Viewers also liked

インテリジェンスに対する提案
インテリジェンスに対する提案インテリジェンスに対する提案
インテリジェンスに対する提案stucon
 
「コンテンツ抽出サービス」と著作権
「コンテンツ抽出サービス」と著作権「コンテンツ抽出サービス」と著作権
「コンテンツ抽出サービス」と著作権Shinya ICHINOHE
 
Ipsos MORI Political Monitor April 2015: Potential Coalition Influencers
Ipsos MORI Political Monitor April 2015: Potential Coalition InfluencersIpsos MORI Political Monitor April 2015: Potential Coalition Influencers
Ipsos MORI Political Monitor April 2015: Potential Coalition InfluencersIpsos UK
 
Pilots Onderwijslogistiek
Pilots OnderwijslogistiekPilots Onderwijslogistiek
Pilots OnderwijslogistiekJoël Bruijn
 
Trade your way to Financial Freedom - Stock Trading with an edge
Trade your way to Financial Freedom - Stock Trading with an edgeTrade your way to Financial Freedom - Stock Trading with an edge
Trade your way to Financial Freedom - Stock Trading with an edgeChristos Pittis
 
playas impactantes !!!
playas impactantes !!!playas impactantes !!!
playas impactantes !!!cinticanale
 
Geef de aarde door
Geef de aarde doorGeef de aarde door
Geef de aarde doorJoël Bruijn
 
Hong Yang p1 presentation
Hong Yang p1 presentationHong Yang p1 presentation
Hong Yang p1 presentationHong Yang
 
Esoteric Insights for October 2013 (sample)
Esoteric Insights for October 2013 (sample)Esoteric Insights for October 2013 (sample)
Esoteric Insights for October 2013 (sample)esotericinsights
 
Training for Results Webinar 2016
Training for Results Webinar 2016Training for Results Webinar 2016
Training for Results Webinar 2016KineoPacific
 
Monsterverlies voor holding Philip Cracco
Monsterverlies voor holding Philip CraccoMonsterverlies voor holding Philip Cracco
Monsterverlies voor holding Philip CraccoThierry Debels
 
Daruma
DarumaDaruma
DarumaBonedz
 
PunkED ipadpalooza 2016
PunkED  ipadpalooza 2016PunkED  ipadpalooza 2016
PunkED ipadpalooza 2016Amy Burvall
 

Viewers also liked (19)

インテリジェンスに対する提案
インテリジェンスに対する提案インテリジェンスに対する提案
インテリジェンスに対する提案
 
「コンテンツ抽出サービス」と著作権
「コンテンツ抽出サービス」と著作権「コンテンツ抽出サービス」と著作権
「コンテンツ抽出サービス」と著作権
 
Ipsos MORI Political Monitor April 2015: Potential Coalition Influencers
Ipsos MORI Political Monitor April 2015: Potential Coalition InfluencersIpsos MORI Political Monitor April 2015: Potential Coalition Influencers
Ipsos MORI Political Monitor April 2015: Potential Coalition Influencers
 
Pilots Onderwijslogistiek
Pilots OnderwijslogistiekPilots Onderwijslogistiek
Pilots Onderwijslogistiek
 
Trade your way to Financial Freedom - Stock Trading with an edge
Trade your way to Financial Freedom - Stock Trading with an edgeTrade your way to Financial Freedom - Stock Trading with an edge
Trade your way to Financial Freedom - Stock Trading with an edge
 
Agriculture
AgricultureAgriculture
Agriculture
 
playas impactantes !!!
playas impactantes !!!playas impactantes !!!
playas impactantes !!!
 
賀寶芙副作用
賀寶芙副作用賀寶芙副作用
賀寶芙副作用
 
Geef de aarde door
Geef de aarde doorGeef de aarde door
Geef de aarde door
 
Zaragoza turismo 214
Zaragoza turismo 214Zaragoza turismo 214
Zaragoza turismo 214
 
Hong Yang p1 presentation
Hong Yang p1 presentationHong Yang p1 presentation
Hong Yang p1 presentation
 
She Is Mine - The Underlying Thought
She Is Mine -  The Underlying ThoughtShe Is Mine -  The Underlying Thought
She Is Mine - The Underlying Thought
 
Who or what is a MAHA RISHI
Who or what is a MAHA RISHIWho or what is a MAHA RISHI
Who or what is a MAHA RISHI
 
Esoteric Insights for October 2013 (sample)
Esoteric Insights for October 2013 (sample)Esoteric Insights for October 2013 (sample)
Esoteric Insights for October 2013 (sample)
 
Training for Results Webinar 2016
Training for Results Webinar 2016Training for Results Webinar 2016
Training for Results Webinar 2016
 
Monsterverlies voor holding Philip Cracco
Monsterverlies voor holding Philip CraccoMonsterverlies voor holding Philip Cracco
Monsterverlies voor holding Philip Cracco
 
Daruma
DarumaDaruma
Daruma
 
PunkED ipadpalooza 2016
PunkED  ipadpalooza 2016PunkED  ipadpalooza 2016
PunkED ipadpalooza 2016
 
sejarah produksi dokumenter
sejarah produksi dokumentersejarah produksi dokumenter
sejarah produksi dokumenter
 

More from Mike Harris

A Divine Data Comedy
A Divine Data ComedyA Divine Data Comedy
A Divine Data ComedyMike Harris
 
Combinators - Lightning Talk
Combinators - Lightning TalkCombinators - Lightning Talk
Combinators - Lightning TalkMike Harris
 
All You Need is Fold in the Key of C#
All You Need is Fold in the Key of C#All You Need is Fold in the Key of C#
All You Need is Fold in the Key of C#Mike Harris
 
All You Need is Fold
All You Need is FoldAll You Need is Fold
All You Need is FoldMike Harris
 
There and Back Again
There and Back AgainThere and Back Again
There and Back AgainMike Harris
 
The Marvelous Land of Higher Order Functions
The Marvelous Land of Higher Order FunctionsThe Marvelous Land of Higher Order Functions
The Marvelous Land of Higher Order FunctionsMike Harris
 
Testing the Next Generation
Testing the Next GenerationTesting the Next Generation
Testing the Next GenerationMike Harris
 
Learn You a Functional JavaScript for Great Good
Learn You a Functional JavaScript for Great GoodLearn You a Functional JavaScript for Great Good
Learn You a Functional JavaScript for Great GoodMike Harris
 

More from Mike Harris (10)

A Divine Data Comedy
A Divine Data ComedyA Divine Data Comedy
A Divine Data Comedy
 
Combinators - Lightning Talk
Combinators - Lightning TalkCombinators - Lightning Talk
Combinators - Lightning Talk
 
C# 7
C# 7C# 7
C# 7
 
Coding f#un
Coding f#unCoding f#un
Coding f#un
 
All You Need is Fold in the Key of C#
All You Need is Fold in the Key of C#All You Need is Fold in the Key of C#
All You Need is Fold in the Key of C#
 
All You Need is Fold
All You Need is FoldAll You Need is Fold
All You Need is Fold
 
There and Back Again
There and Back AgainThere and Back Again
There and Back Again
 
The Marvelous Land of Higher Order Functions
The Marvelous Land of Higher Order FunctionsThe Marvelous Land of Higher Order Functions
The Marvelous Land of Higher Order Functions
 
Testing the Next Generation
Testing the Next GenerationTesting the Next Generation
Testing the Next Generation
 
Learn You a Functional JavaScript for Great Good
Learn You a Functional JavaScript for Great GoodLearn You a Functional JavaScript for Great Good
Learn You a Functional JavaScript for Great Good
 

Recently uploaded

Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyPooja Nehwal
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxraffaeleoman
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMoumonDas2
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaKayode Fayemi
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsaqsarehman5055
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesPooja Nehwal
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxNikitaBankoti2
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AITatiana Gurgel
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar TrainingKylaCullinane
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Delhi Call girls
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Kayode Fayemi
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Chameera Dedduwage
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfSenaatti-kiinteistöt
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubssamaasim06
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Hasting Chen
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...Sheetaleventcompany
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024eCommerce Institute
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardsticksaastr
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 

Recently uploaded (20)

Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night EnjoyCall Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
Call Girl Number in Khar Mumbai📲 9892124323 💞 Full Night Enjoy
 
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptxChiulli_Aurora_Oman_Raffaele_Beowulf.pptx
Chiulli_Aurora_Oman_Raffaele_Beowulf.pptx
 
Mathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptxMathematics of Finance Presentation.pptx
Mathematics of Finance Presentation.pptx
 
If this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New NigeriaIf this Giant Must Walk: A Manifesto for a New Nigeria
If this Giant Must Walk: A Manifesto for a New Nigeria
 
Air breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animalsAir breathing and respiratory adaptations in diver animals
Air breathing and respiratory adaptations in diver animals
 
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara ServicesVVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
VVIP Call Girls Nalasopara : 9892124323, Call Girls in Nalasopara Services
 
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docxANCHORING SCRIPT FOR A CULTURAL EVENT.docx
ANCHORING SCRIPT FOR A CULTURAL EVENT.docx
 
Microsoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AIMicrosoft Copilot AI for Everyone - created by AI
Microsoft Copilot AI for Everyone - created by AI
 
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 93 Noida Escorts >༒8448380779 Escort Service
 
Report Writing Webinar Training
Report Writing Webinar TrainingReport Writing Webinar Training
Report Writing Webinar Training
 
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
Night 7k Call Girls Noida Sector 128 Call Me: 8448380779
 
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
Governance and Nation-Building in Nigeria: Some Reflections on Options for Po...
 
Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)Introduction to Prompt Engineering (Focusing on ChatGPT)
Introduction to Prompt Engineering (Focusing on ChatGPT)
 
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdfThe workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
The workplace ecosystem of the future 24.4.2024 Fabritius_share ii.pdf
 
Presentation on Engagement in Book Clubs
Presentation on Engagement in Book ClubsPresentation on Engagement in Book Clubs
Presentation on Engagement in Book Clubs
 
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
Re-membering the Bard: Revisiting The Compleat Wrks of Wllm Shkspr (Abridged)...
 
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
No Advance 8868886958 Chandigarh Call Girls , Indian Call Girls For Full Nigh...
 
George Lever - eCommerce Day Chile 2024
George Lever -  eCommerce Day Chile 2024George Lever -  eCommerce Day Chile 2024
George Lever - eCommerce Day Chile 2024
 
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, YardstickSaaStr Workshop Wednesday w/ Lucas Price, Yardstick
SaaStr Workshop Wednesday w/ Lucas Price, Yardstick
 
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 97 Noida Escorts >༒8448380779 Escort Service
 

Hiking through the Functional Forest with Fizz Buzz

  • 1. Hiking through the Functional Forest with FizzBuzz Mike Harris | @MikeMKH | comp-phil.blogspot.com
  • 2.
  • 3. The Functional Forest and Object Oriented City
  • 4. The Functional Forest and Object Oriented City
  • 5.
  • 6. let itinerary n = match n with | 0 -> "Rules" | 1 -> "Pattern Matching" | 2 -> "Types" | 3 -> "Higher Order Functions" | _ -> "Farewell" // val itinerary : n:int -> string 
 

  • 7. let itinerary n = match n with | 0 -> "Rules" | 1 -> "Pattern Matching" | 2 -> "Types" | 3 -> "Higher Order Functions" | _ -> "Farewell" itinerary 0 // val it : string = 
 “Rules"
  • 9. int int -> string string
  • 10. Rules • x | 3 and x | 5 => FizzBuzz • x | 3 => Fizz • x | 5 => Buzz • x => string x
  • 11. Rules • x | 3 and x | 5 => FizzBuzz • x | 3 => Fizz • x | 5 => Buzz • x => string x Specific General
  • 17. x Fizz
 Buzz Fizz Buzz x | 15 x | 3 x | 5 xelse Specific General
  • 18. 2 x | 15 x | 3 x | 5 2else
  • 19. 33 Fizz x | 15 x | 3 x | 5 else
  • 20. 55 Buzz x | 15 x | 3 x | 5 else
  • 21. 45 x | 15 x | 3 x | 5 else Fizz
 Buzz
  • 23. let fizzbuzzer x = if x % 15 = 0 then "FizzBuzz" elif x % 3 = 0 then "Fizz" elif x % 5 = 0 then "Buzz" else string x Conditional F#
  • 24. let itinerary n = match n with | 0 -> "Rules" | 1 -> "Pattern Matching" | 2 -> "Types" | 3 -> "Higher Order Functions" | _ -> "Farewell" itinerary 1 // val it : string = 
 “Pattern Matching"
  • 25.
  • 26. — ⽼老⼦子 trans. James Legge,
 道德經, 64 “The journey of a thousand li commences with a single step.”
  • 28. x Fizz
 Buzz Fizz Buzz x | 15 x | 3 x | 5 x_ Specific General
  • 29. let fizzbuzzer x = match x with | x when x % 15 = 0 ->
 "FizzBuzz"
 | x when x % 3 = 0 -> "Fizz"
 | x when x % 5 = 0 -> "Buzz"
 | _ -> string x Pattern Match F#
  • 31. x | 3,
 x | 5 Fizz
 Buzz Fizz Buzz 0, 0 0, _ _, 0 x_ Specific General
  • 32. let fizzbuzzer x = match x % 3, x % 5 with | 0, 0 -> "FizzBuzz" | 0, _ -> "Fizz" | _, 0 -> "Buzz" | _ -> string x Pattern Match
 with Tuples F#
  • 33. x | 3 = 0,
 x | 5 = 0 Fizz
 Buzz Fizz Buzz T, T T, F F, T xF, F
  • 34. x | 3 = 0,
 x | 5 = 0 x Buzz Fizz F, F F, T T, F Fizz
 BuzzT, T
  • 35. let fizzbuzzer x = match x % 3 = 0, x % 5 = 0 with | false, false -> string x | false, true -> "Buzz" | true, false -> "Fizz" | true, true -> "FizzBuzz" Pattern Match
 with Tuples F#
  • 36. let itinerary n = match n with | 0 -> "Rules" | 1 -> "Pattern Matching" | 2 -> "Types" | 3 -> "Higher Order Functions" | _ -> "Farewell" itinerary 2 // val it : string = 
 “Types"
  • 38. value π type 1 type 2 type 3 type n
  • 44. type FizzBuzzer = | FizzBuzz | Fizz | Buzz | Other of int let fizzbuzzing x = match x % 3 = 0, x % 5 = 0 with | true, true -> FizzBuzz | true, false -> Fizz | false, true -> Buzz | false, false -> Other(x) let fizzbuzzer x = match fizzbuzzing x with | FizzBuzz -> "FizzBuzz" | Fizz -> "Fizz" | Buzz -> "Buzz" | Other(x) -> string x Discriminated
 Union F#
  • 45. type FizzBuzzer = | FizzBuzz | Fizz | Buzz | Other of int … Discriminated
 Union F#
  • 46. type FizzBuzzer = | FizzBuzz | Fizz | Buzz | Other of int let fizzbuzzing x = match x % 3 = 0, x % 5 = 0 with | true, true -> FizzBuzz | true, false -> Fizz | false, true -> Buzz | false, false -> Other(x) … Discriminated
 Union F#
  • 47. … let fizzbuzzing x = match x % 3 = 0, x % 5 = 0 with | true, true -> FizzBuzz | true, false -> Fizz | false, true -> Buzz | false, false -> Other(x) let fizzbuzzer x = match fizzbuzzing x with | FizzBuzz -> "FizzBuzz" | Fizz -> "Fizz" | Buzz -> "Buzz" | Other(x) -> string x Discriminated
 Union F#
  • 48. … let fizzbuzzer x = match fizzbuzzing x with | FizzBuzz -> "FizzBuzz" | Fizz -> "Fizz" | Buzz -> "Buzz" | Other(x) -> string x Discriminated
 Union F#
  • 49. type FizzBuzzer = | FizzBuzz | Fizz | Buzz | Other of int let fizzbuzzing x = match x % 3 = 0, x % 5 = 0 with | true, true -> FizzBuzz | true, false -> Fizz | false, true -> Buzz | false, false -> Other(x) let fizzbuzzer x = match fizzbuzzing x with | FizzBuzz -> "FizzBuzz" | Fizz -> "Fizz" | Buzz -> "Buzz" | Other(x) -> string x Discriminated
 Union F#
  • 51. value anonymous type 1 type 2 type 3 type n
  • 57. let (|FizzBuzz|Fizz|Buzz|Other|) x = match x % 3 = 0, x % 5 = 0 with | true, true -> FizzBuzz | true, false -> Fizz | false, true -> Buzz | false, false -> Other(x) let fizzbuzzer x = match x with | FizzBuzz -> "FizzBuzz" | Fizz -> "Fizz" | Buzz -> "Buzz" | Other(x) -> string x Complete
 Active Pattern F#
  • 58. let (|FizzBuzz|Fizz|Buzz|Other|) x = match x % 3 = 0, x % 5 = 0 with | true, true -> FizzBuzz | true, false -> Fizz | false, true -> Buzz | false, false -> Other(x) … Complete
 Active Pattern F#
  • 59. … let fizzbuzzer x = match x with | FizzBuzz -> "FizzBuzz" | Fizz -> "Fizz" | Buzz -> "Buzz" | Other(x) -> string x Complete
 Active Pattern F#
  • 60. let (|FizzBuzz|Fizz|Buzz|Other|) x = match x % 3 = 0, x % 5 = 0 with | true, true -> FizzBuzz | true, false -> Fizz | false, true -> Buzz | false, false -> Other(x) let fizzbuzzer x = match x with | FizzBuzz -> "FizzBuzz" | Fizz -> "Fizz" | Buzz -> "Buzz" | Other(x) -> string x Complete
 Active Pattern F#
  • 63. 33 divisible by Some 3
  • 64. 2 divisible by None 3
  • 65. let (|DivisibleBy|_|) divisor x = if x % divisor = 0 then Some () else None let fizzbuzzer x = match x with | DivisibleBy 3 & DivisibleBy 5 -> "FizzBuzz" | DivisibleBy 3 -> "Fizz" | DivisibleBy 5 -> "Buzz" | _ -> string x Partial
 Active Pattern F#
  • 66. let (|DivisibleBy|_|) divisor x = if x % divisor = 0 then Some () else None … Partial
 Active Pattern F#
  • 67. … let fizzbuzzer x = match x with | DivisibleBy 3 & DivisibleBy 5 -> “FizzBuzz" | DivisibleBy 3 -> “Fizz" | DivisibleBy 5 -> “Buzz" | _ -> string x Partial
 Active Pattern F#
  • 68. let (|DivisibleBy|_|) divisor x = if x % divisor = 0 then Some () else None let fizzbuzzer x = match x with | DivisibleBy 3 & DivisibleBy 5 -> "FizzBuzz" | DivisibleBy 3 -> "Fizz" | DivisibleBy 5 -> "Buzz" | _ -> string x Partial
 Active Pattern F#
  • 69. let itinerary n = match n with | 0 -> "Rules" | 1 -> "Pattern Matching" | 2 -> "Types" | 3 -> "Higher Order Functions" | _ -> "Farewell" itinerary 3 // val it : string = 
 “Higher Order Functions"
  • 70. Fold
  • 79. 6+ 4
  • 80. 10+
  • 81. “”m f -> m ++ f x x | 3 ? Fizz : “” x | 5 ? Buzz : “”
  • 82. “”m f -> m ++ f 3 3 | 3 ? Fizz : “” x | 5 ? Buzz : “”
  • 83. Fizzm f -> m ++ f 3 3 | 5 ? Buzz : “” “Fizz”:“”
  • 84. Fizzm f -> m ++ f 3 “Buzz”:“”
  • 85. “”m f -> m ++ f 15 15 | 3 ? Fizz : “” x | 5 ? Buzz : “”
  • 86. Fizzm f -> m ++ f 15 15 | 5 ? Buzz : “” “Fizz”:“”
  • 87. Fizz
 Buzz m f -> m ++ f 15 “Buzz”:“”
  • 88. let fizzbuzzer x = let rule d s = (fun x -> if x % d = 0 then s else "") [rule 3 "Fizz"; rule 5 "Buzz"] |> List.fold (fun m f -> m + f x) "" |> (fun s -> if s = "" then string x else s)Fold F#
  • 89. … let rule d s = (fun x -> if x % d = 0 then s else "") … Fold F#
  • 90. … let rule d s = (fun x -> if x % d = 0 then s else "") [rule 3 "Fizz"; rule 5 "Buzz"] … Fold F#
  • 91. … [rule 3 "Fizz"; rule 5 "Buzz"] … Fold F#
  • 92. … [rule 3 "Fizz"; rule 5 "Buzz"] |> List.fold (fun m f -> m + f x) "" … Fold F#
  • 93. … |> (fun s -> if s = "" then string x else s) Fold F#
  • 94. let fizzbuzzer x = let rule d s = (fun x -> if x % d = 0 then s else "") [rule 3 "Fizz"; rule 5 "Buzz"] |> List.fold (fun m f -> m + f x) "" |> (fun s -> if s = "" then string x else s)Fold F#
  • 95. Zip
  • 96. function result i result ii result iii result p value 1 value 2 value 3 value n value a value b value c value m
  • 99. let fizzbuzzer x = let rec fizz = seq { yield "Fizz"; yield ""; yield ""; yield! fizz } let rec buzz = seq { yield "Buzz"; yield ""; yield ""; yield ""; yield ""; yield! buzz } Seq.map2 (+) fizz buzz |> Seq.item (abs x) |> (fun s -> if s = "" then string x else s) Zip F#
  • 100. … let rec fizz = seq { yield "Fizz"; yield ""; yield ""; yield! fizz } let rec buzz = seq { yield "Buzz"; yield ""; yield ""; yield ""; yield ""; yield! buzz } … Zip F#
  • 101. … Seq.map2 (+) fizz buzz … Zip F#
  • 102. … Seq.map2 (+) fizz buzz |> Seq.item (abs x) … Zip F#
  • 103. … Seq.map2 (+) fizz buzz |> Seq.item (abs x) |> (fun s -> if s = "" then string x else s) Zip F#
  • 104. let fizzbuzzer x = let rec fizz = seq { yield "Fizz"; yield ""; yield ""; yield! fizz } let rec buzz = seq { yield "Buzz"; yield ""; yield ""; yield ""; yield ""; yield! buzz } Seq.map2 (+) fizz buzz |> Seq.item (abs x) |> (fun s -> if s = "" then string x else s) Zip F#
  • 105. let itinerary n = match n with | 0 -> "Rules" | 1 -> "Pattern Matching" | 2 -> "Types" | 3 -> "Higher Order Functions" | _ -> "Farewell" itinerary 4 // val it : string = 
 “Farewell"
  • 106.
  • 107. — Friedrich Nietzsche trans. R.J. Hollingdale,
 Human, All Too Human, “The Wanderer and His Shadow”, 324 “How can anyone become a thinker if he does not spend at least a third of the day without passions, people, and books?”
  • 109. Images • Klamath National Forest, NFS road 16N05 about 8 miles South of Happy Camp, California. Taken by Erik Wheaton, http://www.burningwell.org/gallery2/v/Landscapes/forrests/ 16N05_March_05.jpg.html • View of São Paulo city from Núcleo Pedra Grande in Cantareira State Park. From https:// commons.wikimedia.org/wiki/File:Vista_de_s%C3%A3o_paulo_cantareira.jpg • Centro de São Paulo, Brasil. Taken by Ana Paula Hirama, https://commons.wikimedia.org/wiki/ File:Centro_SP2.jpg • F# logomark, by Unknown at the source. Fair use, https://en.wikipedia.org/w/index.php? curid=44014320 • Lao-Tzu, by Lawrencekhoo - http://www.eng.taoism.org.hk/daoist-beliefs/immortals&immortalism/, Public Domain, https://commons.wikimedia.org/w/index.php?curid=3991827 • Friedrich Nietzsche, by Unknown - http://ora-web.swkk.de/nie_brief_online/nietzsche.digitalisate? id=234&nr=1, Public Domain, https://commons.wikimedia.org/w/index.php?curid=95964 • Me at StrangeLoop 2014. Taken by Kelsey Harris.
  • 110. Source Code • Conditional
 https://gist.github.com/MikeMKH/9866f9923fa4dfa140e6 • Pattern Matching
 https://gist.github.com/MikeMKH/ 3fe93b2feea575f075fc54aecff2f01c • Pattern Matching with Tuple
 https://gist.github.com/MikeMKH/9b35eb70ffdbcb605efa • Pattern Matching with Tuple using True / False
 https://gist.github.com/MikeMKH/ f0d7f21554500ffc4de60d6acefca4a5
  • 111. Source Code • Discriminated Union
 https://gist.github.com/MikeMKH/ 05d95775276744c304d2e4e253960aba • Complete Active Pattern
 https://gist.github.com/MikeMKH/ 15a837dbb24053320abb • Partial Active Pattern
 https://gist.github.com/MikeMKH/ a38be4d25641980a8dda
  • 112. Source Code • Fold
 https://gist.github.com/MikeMKH/ 39dbbc94d963df436c62 • Zip
 https://gist.github.com/MikeMKH/ c107d578d727ba514d05fc8bfa078bb7
  • 113. Books • Brandewinder, Mathias. Machine learning projects for .NET Developers. Berkeley, CA New York, NY: Apress, 2015. Print. • Fancher, Dave. The book of F♯ : breaking free with managed functional programming. San Francisco: No Starch Press, 2014. Print. • Lipovača, Miran. Learn you a Haskell for great good! a beginner's guide. San Francisco, Calif: No Starch Press, 2011. Print. • Michaelson, Greg. An introduction to functional programming through Lambda calculus. Mineola, N.Y: Dover Publications, 2011. Print.
  • 114. Websites • Wlaschin, Scoot. F# for Fun and Profit. Web. 16 May 2016. <https://fsharpforfunandprofit.com/>. • Seemann, Mark. ploeh blog. Web. 16 May 2016. < http://blog.ploeh.dk/ >.
  • 115. Papers • Emir, Burak, Odersky, Martin and Williams, John. Matching Objects With Patterns. LAMP-REPORT-2006-006. • Hutton, Graham. A tutorial on the universality and expressiveness of fold. J. Functional Programming, 9 (4): 355–372, July 1999. • Petricek, Tomas and Syme, Don. The F# Computation Expression Zoo. Proceedings of Practical Aspects of Declarative Languages, PADL 2014. San Diego, CA, USA. • Wadler, Philip. Views︎: A way for pattern matching to cohabit with data abstraction. March ︎︎︎︎1987.