Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Functional Geekery for an Imperative Mind
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Rajeev Bharshetty
April 04, 2015
Programming
300
0
Share
Functional Geekery for an Imperative Mind
Slides for the talk at RubyConf India 2015
Rajeev Bharshetty
April 04, 2015
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
How Swift's Type System Guides AI Agents
koher
0
330
From Formal Specification to Property Based Test
ohbarye
0
670
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
520
The Less-Told Story of Socket Timeouts
coe401_
3
930
エラー処理の温故知新 / history of error handling technic
ryotanakaya
7
1.8k
AWSコミュニティ活動は顧客のクラウド推進に効くのか / Do AWS community activities help customers adopt the cloud?
seike460
PRO
0
160
2026-04-15 Spring IO - I Can See Clearly Now
jonatan_ivanov
1
160
実用!Hono RPC2026
yodaka
2
290
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
330
「話せることがない」を乗り越える 〜日常業務から登壇テーマをつくる思考法〜
shoheimitani
4
960
AIと共に生きる技術選定 2026
sgash708
0
120
PHPでローカル環境用のSSL/TLS証明書を発行することはできるのか? #phpconkagawa
akase244
0
310
Featured
See All Featured
The SEO Collaboration Effect
kristinabergwall1
1
440
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
230
The Cost Of JavaScript in 2023
addyosmani
55
9.9k
The Spectacular Lies of Maps
axbom
PRO
1
730
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
170
The Curious Case for Waylosing
cassininazir
0
340
Building Adaptive Systems
keathley
44
3k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
We Have a Design System, Now What?
morganepeng
55
8.1k
Imperfection Machines: The Place of Print at Facebook
scottboms
270
14k
Skip the Path - Find Your Career Trail
mkilby
1
110
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
350
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?