SlideShare a Scribd company logo
1 of 54
Download to read offline
#10 good 
reasons to 
invest your 
time in FP 
Humberto Streb 
@humbertostreb 
Joel Corrêa 
@joelcorrea_
#1 Learn
#2 Parallel collections
Multicore powered 
Parallel collections 
F#
Collection operations: 
Map - Reduce
Higher order functions 
Map –> Applies a given fn to each 
element 
Reduce –> Combine / Accumulate / 
fold / compress results though 
combining operation
Sample
Map 
Map 
age 
20 18 25 41 29 32 38 30
Reduce 
20 18 
25 44 29 32 … 
236 
Combining fn: a+b 
(operation = +)
+ Data 
Map age Map age Map age Map age
map in parallel
reduce in parallel
filter in parallel
#3 Focus
Boilerplate code
REPL
#4 Troubleshooting
Same result value 
given the same 
arguments
Troubleshooting in FP 
Referential transparency 
Consistency 
No global state 
Arguments only 
Once wrong, always wrong
#5 State discipline
Side effects…
Pure function
Immutable 
It is highly 
recommended that value 
objects be immutable. 
They are created with a 
constructor, and never 
modified during their 
life time. 
Eric Evans
Immutable
Immutable
#6 Built-ins
Futures 
Non-Blocking 
Parallel
Optionals 
Null checks 
Explicit
Interoperability
#8 Simplicity 
#7 Simplicity
#8 Simplicity 
Salesmen…
#8 Simplicity
#8 Composition
# Building blocks 
Inheritance 
Polymorphism 
HOFs 
Composition 
OOP = 
Objects 
FP = 
Functions 
Real world / Complex scenarios
# HOFs 
Receives fn
# Partially applied 
Returns fn
# Composition
#9 Testability
Hard to test 
if($player->getScore() > 0) {! 
!$player->setSwizzle(7);! 
} else {! 
!$player->setSwizzle(! 
! !$player->getSwizzle() + 1;! 
!);! 
}!
#10 Principles
FP in non-FP languages 
Referen'al 
transparency 
Side effects 
Immutabilit 
y 
Guidelines
FP in non-FP languages 
functools 
LuaFun
# Challenges ahead
Readability / Expressiveness
Learning curve
Samples 
https://github.com/jjcorrea/ 
TenGoodReasonsToInvestYourTimeInFP 
Resources 
http://twitter.github.io/scala_school/ 
http://twitter.github.io/effectivescala 
http://coursera.org/course/progfun

More Related Content

Viewers also liked

Do lidar bulletin_2070
Do lidar bulletin_2070Do lidar bulletin_2070
Do lidar bulletin_2070
Sam Ranjit
 
Humrich shane ignite_slideshow
Humrich shane ignite_slideshowHumrich shane ignite_slideshow
Humrich shane ignite_slideshow
Shane Humrich
 
Real world Python+django
Real world Python+djangoReal world Python+django
Real world Python+django
Joel Corrêa
 
Concurrent paradigms - Paralelism approaches
Concurrent paradigms - Paralelism approachesConcurrent paradigms - Paralelism approaches
Concurrent paradigms - Paralelism approaches
Joel Corrêa
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmer
Joel Corrêa
 

Viewers also liked (18)

PRESENTATION
PRESENTATIONPRESENTATION
PRESENTATION
 
Do lidar bulletin_2070
Do lidar bulletin_2070Do lidar bulletin_2070
Do lidar bulletin_2070
 
Humrich shane ignite_slideshow
Humrich shane ignite_slideshowHumrich shane ignite_slideshow
Humrich shane ignite_slideshow
 
Evolucion de la empresa en colombia (1)
Evolucion de la empresa en colombia (1)Evolucion de la empresa en colombia (1)
Evolucion de la empresa en colombia (1)
 
Lift web framework
Lift web frameworkLift web framework
Lift web framework
 
Simple past tense
Simple past tenseSimple past tense
Simple past tense
 
iOS Development - Tips & Tricks
iOS Development - Tips & TricksiOS Development - Tips & Tricks
iOS Development - Tips & Tricks
 
Ooad presentation
Ooad presentationOoad presentation
Ooad presentation
 
Social class dialects
Social class dialectsSocial class dialects
Social class dialects
 
Book review To Kill A Mockingbird
Book review To Kill A MockingbirdBook review To Kill A Mockingbird
Book review To Kill A Mockingbird
 
Real world Python+django
Real world Python+djangoReal world Python+django
Real world Python+django
 
Concurrent paradigms - Paralelism approaches
Concurrent paradigms - Paralelism approachesConcurrent paradigms - Paralelism approaches
Concurrent paradigms - Paralelism approaches
 
The pragmatic programmer
The pragmatic programmerThe pragmatic programmer
The pragmatic programmer
 
Zippers presentation
Zippers presentationZippers presentation
Zippers presentation
 
LXC outline
LXC outlineLXC outline
LXC outline
 
GraphQL
GraphQLGraphQL
GraphQL
 
Task based language teaching
Task based language teachingTask based language teaching
Task based language teaching
 
The grammar translation method
The grammar translation methodThe grammar translation method
The grammar translation method
 

Similar to 10 good reasons to invest your time in FP

Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event Systems
Leonardo Borges
 
What the math geeks don't want you to know about F#
What the math geeks don't want you to know about F#What the math geeks don't want you to know about F#
What the math geeks don't want you to know about F#
Kevin Hazzard
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
Mario Fusco
 
Functional pogramming hl overview
Functional pogramming hl overviewFunctional pogramming hl overview
Functional pogramming hl overview
Elad Avneri
 

Similar to 10 good reasons to invest your time in FP (20)

Real World F# - SDD 2015
Real World F# -  SDD 2015Real World F# -  SDD 2015
Real World F# - SDD 2015
 
Brixton Library Technology Initiative Week1 Recap
Brixton Library Technology Initiative Week1 RecapBrixton Library Technology Initiative Week1 Recap
Brixton Library Technology Initiative Week1 Recap
 
Functional Programming in C# and F#
Functional Programming in C# and F#Functional Programming in C# and F#
Functional Programming in C# and F#
 
Introduction to functional programming
Introduction to functional programmingIntroduction to functional programming
Introduction to functional programming
 
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
Progressive f# tutorials nyc rachel reese & phil trelford on try f# from zero...
 
The Functional Rubyist: A Primer
The Functional Rubyist: A PrimerThe Functional Rubyist: A Primer
The Functional Rubyist: A Primer
 
Practical F#
Practical F#Practical F#
Practical F#
 
Functional programming and ruby in functional style
Functional programming and ruby in functional styleFunctional programming and ruby in functional style
Functional programming and ruby in functional style
 
Intro to Functional Programming
Intro to Functional ProgrammingIntro to Functional Programming
Intro to Functional Programming
 
Functional Programming in JavaScript
Functional Programming in JavaScriptFunctional Programming in JavaScript
Functional Programming in JavaScript
 
Functional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event SystemsFunctional Reactive Programming / Compositional Event Systems
Functional Reactive Programming / Compositional Event Systems
 
Kickstart programing part 2
Kickstart programing   part 2Kickstart programing   part 2
Kickstart programing part 2
 
What the math geeks don't want you to know about F#
What the math geeks don't want you to know about F#What the math geeks don't want you to know about F#
What the math geeks don't want you to know about F#
 
If You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are WrongIf You Think You Can Stay Away from Functional Programming, You Are Wrong
If You Think You Can Stay Away from Functional Programming, You Are Wrong
 
Functional pogramming hl overview
Functional pogramming hl overviewFunctional pogramming hl overview
Functional pogramming hl overview
 
vpTech - Practical F# in Finance
vpTech - Practical F# in FinancevpTech - Practical F# in Finance
vpTech - Practical F# in Finance
 
FSharp in the enterprise
FSharp in the enterpriseFSharp in the enterprise
FSharp in the enterprise
 
Optimized Floating-point Complex number multiplier on FPGA
Optimized Floating-point Complex number multiplier on FPGAOptimized Floating-point Complex number multiplier on FPGA
Optimized Floating-point Complex number multiplier on FPGA
 
ForLoops.pptx
ForLoops.pptxForLoops.pptx
ForLoops.pptx
 
The secret of Functional Programming revealed!
The secret of Functional Programming revealed!The secret of Functional Programming revealed!
The secret of Functional Programming revealed!
 

Recently uploaded

%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
masabamasaba
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
masabamasaba
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
WSO2CON 2024 - WSO2's Digital Transformation Journey with Choreo: A Platforml...
 
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Toronto Psychic Readings, Attraction spells,Brin...
 
Architecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the pastArchitecture decision records - How not to get lost in the past
Architecture decision records - How not to get lost in the past
 
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
WSO2CON 2024 - Building the API First Enterprise – Running an API Program, fr...
 
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
OpenChain - The Ramifications of ISO/IEC 5230 and ISO/IEC 18974 for Legal Pro...
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
WSO2CON 2024 - Navigating API Complexity: REST, GraphQL, gRPC, Websocket, Web...
 
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
WSO2CON 2024 - Cloud Native Middleware: Domain-Driven Design, Cell-Based Arch...
 
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
%in Bahrain+277-882-255-28 abortion pills for sale in Bahrain
 
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
WSO2Con2024 - From Code To Cloud: Fast Track Your Cloud Native Journey with C...
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?WSO2CON 2024 - Does Open Source Still Matter?
WSO2CON 2024 - Does Open Source Still Matter?
 
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
MarTech Trend 2024 Book : Marketing Technology Trends (2024 Edition) How Data...
 
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With SimplicityWSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
WSO2Con2024 - Enabling Transactional System's Exponential Growth With Simplicity
 
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
%+27788225528 love spells in Knoxville Psychic Readings, Attraction spells,Br...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
WSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaSWSO2CON 2024 Slides - Open Source to SaaS
WSO2CON 2024 Slides - Open Source to SaaS
 
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
%+27788225528 love spells in Huntington Beach Psychic Readings, Attraction sp...
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni%in Benoni+277-882-255-28 abortion pills for sale in Benoni
%in Benoni+277-882-255-28 abortion pills for sale in Benoni
 

10 good reasons to invest your time in FP