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
Rajeev Bharshetty
April 04, 2015
Programming
310
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
170
What's New in Android 2026
veronikapj
0
210
AIキャラアプリkaiwaの低遅延音声通話基盤をどう作ったか - AWS Gravitonで支える低遅延・低コストAI Agent基盤
mogamit
0
190
광주소프트웨어마이스터고등학교 DevFest 특강 - 바이브 코딩 시대에서 주니어 개발자로 살아남는 방법
utilforever
1
150
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
180
php-fpmのプロセスが枯渇した日-調査・対処・そして本当にやるべきだったこと-
shibuchaaaan
0
140
Generative UI & AI-Assistants for Your Angular Solutions
manfredsteyer
PRO
1
230
Laravelで学ぶ Webアプリケーションチューニング入門/web_application_tuning_101
hanhan1978
4
1.3k
Built Our Own Background Agent at LayerX #aidevex_findy
layerx
PRO
8
3.4k
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
410
為什麼你並不需要ViewModel / No, you don't need a ViewModel
lovee
1
360
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
3.1k
Featured
See All Featured
Information Architects: The Missing Link in Design Systems
soysaucechin
0
1k
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
510
Stewardship and Sustainability of Urban and Community Forests
pwiseman
0
380
How to train your dragon (web standard)
notwaldorf
97
6.7k
Code Reviewing Like a Champion
maltzj
528
40k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
230
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.3k
Highjacked: Video Game Concept Design
rkendrick25
PRO
1
410
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
190
Design in an AI World
tapps
1
270
Designing Experiences People Love
moore
143
24k
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
230
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?