Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Functional Geekery for an Imperative Mind
Search
Rajeev Bharshetty
April 04, 2015
Programming
0
290
Functional Geekery for an Imperative Mind
Slides for the talk at RubyConf India 2015
Rajeev Bharshetty
April 04, 2015
Tweet
Share
More Decks by Rajeev Bharshetty
See All by Rajeev Bharshetty
SPDY : Let's Make the Web Faster
rshetty01
2
180
Other Decks in Programming
See All in Programming
ゲームの物理 剛体編
fadis
0
350
20251127_ぼっちのための懇親会対策会議
kokamoto01_metaps
2
450
Canon EOS R50 V と R5 Mark II 購入でみえてきた最近のデジイチ VR180 事情、そして VR180 静止画に活路を見出すまで
karad
0
130
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
500
S3 VectorsとStrands Agentsを利用したAgentic RAGシステムの構築
tosuri13
6
350
Rediscover the Console - SymfonyCon Amsterdam 2025
chalasr
2
180
Rubyで鍛える仕組み化プロヂュース力
muryoimpl
0
140
AtCoder Conference 2025「LLM時代のAHC」
imjk
2
530
Socio-Technical Evolution: Growing an Architecture and Its Organization for Fast Flow
cer
PRO
0
370
「コードは上から下へ読むのが一番」と思った時に、思い出してほしい話
panda728
PRO
39
26k
AIコーディングエージェント(skywork)
kondai24
0
180
チームをチームにするEM
hitode909
0
350
Featured
See All Featured
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
170
Designing for Performance
lara
610
69k
Unsuck your backbone
ammeep
671
58k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
180
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
18
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.6k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
280
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
120
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
170
The B2B funnel & how to create a winning content strategy
katarinadahlin
PRO
0
170
What's in a price? How to price your products and services
michaelherold
246
13k
Rails Girls Zürich Keynote
gr2m
95
14k
Transcript
FUNCTIONAL GEEKERY FOR AN IMPERATIVE MIND Rajeev N B
@rshetty on Github @rbharshetty on Twitter
None
SIMON PEYTON JONES
NIRVANA C, C++, Java, Ruby .. Haskell Nirvana Useful Less
Useful Unsafe Safe
IMPERATIVE VS FUNCTIONAL
PROPERTY IMPERATIVE FUNCTIONAL FOCUS Changing existing values Declaring new values
CONTROL FLOW Loops, Conditionals and Function calls Functional calls including Recursion MANIPULATION UNIT Instances of classes and structs Functions and Data Structures. MENTAL MODEL Algorithmic Programming Composing problems with set of functions.
FUNCTIONAL PROGRAMMING?
– John Hughes (Why Functional Programming Matters) “Functional Programming is
so called because a program consists entirely of functions”
CONCEPTS
FUNCTION COMPOSITION (F O G)
It is the act of pipelining result of a function
into input of another, creating a new function
Function g(x) x + 1 Function f(x) x * x
x = 3 g(x)= 4 f(g(x))= 16
None
None
It is the act of pipelining result of a function
into input of with another, creating a new function
None
None
None
LAZY EVALUATION
Evaluation of a expression is deferred until the result is
needed by other computations
LAZY EVALUATION Call by need Infinite Data structures Thunks Performant
HIGHER ORDER FUNCTIONS
Functions which either take functions as arguments or return functions
as return values
None
None
CURRYING
Transforming function that takes multiple arguments into function that takes
single argument
None
None
PURE FUNCTION
Function that returns exactly the same result every time it
is called with same set of arguments
Pure Function f(x) = Math.cos(x) Pure Function ( No Side
Effects ) x f(x)
None
REFERENTIAL TRANSPARENCY Expression is referentially transparent if it can be
replaced with its value Property of Pure functions No side effects Easier to reason about programs
WHY PURE FUNCTIONS? Reproducible results Memoization Parallelization
IMMUTABILITY
Immutable object is an object whose state cannot be modified
after it is created
IMMUTABLE DATA STRUCTURES Data structure once created cannot be modified
Uses sophisticated structure sharing
WHY? Concurrency Security
FUNCTIONAL THINKING
REFERENCES Haskell Wiki Learn You a Haskell Ruby Function Composition
Resurgence of Functional Programming Code samples
THANKS
QUESTIONS?