You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Functional programming (FP) provides many advantages, and its popularity has been increasing as a result. However, each programming paradigm comes with its own unique jargon and FP is no exception. By providing a glossary, we hope to make learning FP easier.
4
6
5
7
This is a fork of [Functional Programming Jargon](https://github.com/jmesyou/functional-programming-jargon).
@@ -180,7 +182,7 @@ You can also use `functools.partial` to partially apply a function in Python:
180
182
#TODO
181
183
```
182
184
183
-
Partial application helps create simpler functions from more complex ones by baking in data when you have it. [Curried](#currying-todo) functions are automatically partially applied.
185
+
Partial application helps create simpler functions from more complex ones by baking in data when you have it. [Curried](#currying) functions are automatically partially applied.
184
186
185
187
186
188
## Currying
@@ -204,6 +206,7 @@ can also take several of arguments instead of just a single argument:
204
206
205
207
```python
206
208
>>>assert takes_three_args(1, 2)(3) ==6
209
+
>>>assert takes_three_args(1)(2, 3) ==6
207
210
>>>assert takes_three_args(1, 2, 3) ==6
208
211
```
209
212
@@ -251,6 +254,7 @@ Continuations are often seen in asynchronous programming when the program needs
251
254
#TODO
252
255
```
253
256
257
+
254
258
## Side effects
255
259
256
260
A function or expression is said to have a side effect if apart from returning a value,
@@ -267,6 +271,7 @@ numbers = []
267
271
numbers.append(1) # mutates the `numbers` array
268
272
```
269
273
274
+
270
275
## Purity
271
276
272
277
A function is pure if the return value is only determined by its
@@ -287,6 +292,7 @@ As opposed to each of the following:
287
292
...return first + second
288
293
```
289
294
295
+
290
296
## Idempotent
291
297
292
298
A function is idempotent if reapplying it to its result does not produce a different result:
@@ -299,7 +305,7 @@ A function is idempotent if reapplying it to its result does not produce a diffe
299
305
300
306
## Point-Free Style (TODO)
301
307
302
-
Writing functions where the definition does not explicitly identify the arguments used. This style usually requires [currying](#currying-todo) or other [Higher-Order functions](#higher-order-functions-hof-todo). A.K.A Tacit programming.
308
+
Writing functions where the definition does not explicitly identify the arguments used. This style usually requires [currying](#currying) or other [Higher-Order functions](#higher-order-functions-hof-todo). A.K.A Tacit programming.
0 commit comments