Curated from: joshi-aparna.github.io
Ideas, facts & insights covering these topics:
7 ideas
·1.6K reads
17
Explore the World's Best Ideas
Join today and uncover 100+ curated journeys from 50+ topics. Unlock access to our mobile app with extensive features.
Funcational Programming is a declarative way of programming.
24
547 reads
Remember how we assign different values to a variable through out the program? How we use setters in classes to modify the value of class variables? That is not allowed in FP. A variable once set remains unchanged. Sort of like, making all variables final.
We usually think of variables as vessels that hold the values. The vessel can hold different values at different times. But in FP, variables are just another name for their values. Like, PI is always 3.14..Ever imagined a different value for PI? No? In the same way, every x, y in your program can now have a single value.
24
216 reads
If a function returns same value for the same argument every time, then the function is pure. That generally means that, the function cannot use any state values that could potentially change.
23
212 reads
In OOP we treat data and functions separately. In FP, they are all the same. We can create an array of functions, pass a function as argument, return a function from a method.
22
218 reads
Let's say there is a function that takes three arguments. Usually, we need to be aware of all three values to call this function, right? In partial application, the three arguments are provided at different times. I could not find a decent blog that explains this well. Here is the wikipedia page.
23
144 reads
This is a method where we take simple functions and combine them into a more complex function. Let's say we have two methods f(x) = x * 2 //(timesTwo)
and f(x) = x - 1 // (minusOne)
. And we want to compute f(x) = 2x -1
. You call the timesTwo
function first. With the output of timesTwo
, you call the minusOne
function. How would you code this?
The requirement here is that the next function takes as argument the same type that the previous function returns.
23
125 reads
IDEAS CURATED BY
CURATOR'S NOTE
Not your object oriented programming
“
Learn more about computerscience with this collection
Understanding machine learning models
Improving data analysis and decision-making
How Google uses logic in machine learning
Related collections
Similar ideas
4 ideas
Type Checking Paradigms
en.wikipedia.org
4 ideas
An introduction to Python Type Hints
peps.python.org
11 ideas
Read & Learn
20x Faster
without
deepstash
with
deepstash
with
deepstash
Personalized microlearning
—
100+ Learning Journeys
—
Access to 200,000+ ideas
—
Access to the mobile app
—
Unlimited idea saving
—
—
Unlimited history
—
—
Unlimited listening to ideas
—
—
Downloading & offline access
—
—
Supercharge your mind with one idea per day
Enter your email and spend 1 minute every day to learn something new.
I agree to receive email updates