Skip to content

Commit 5f9cdd6

Browse files
jethrolarsonhemanth
authored andcommitted
Added Lambda and Lambda Calculus #87 (#89)
1 parent 4cd9112 commit 5f9cdd6

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

readme.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,32 @@ referentially transparent.
356356

357357
When an application is composed of expressions and devoid of side effects, truths about the system can be derived from the parts.
358358

359+
## Lambda
360+
361+
An anonymous function that can be treated like a value.
362+
363+
```js
364+
function(a){
365+
return a + 1;
366+
};
367+
368+
(a) => a + 1;
369+
```
370+
Lambdas are often passed as arguments to Higher-Order functions.
371+
372+
```js
373+
[1, 2].map((a) => a + 1); // [2, 3]
374+
```
375+
376+
You can assign a lambda to a variable.
377+
378+
```js
379+
const add1 = (a) => a + 1;
380+
```
381+
382+
## Lambda Calculus
383+
A branch of mathematics that uses functions to create a [universal model of computation](https://en.wikipedia.org/wiki/Lambda_calculus).
384+
359385
## Lazy evaluation
360386

361387
Lazy evaluation is a call-by-need evaluation mechanism that delays the evaluation of an expression until its value is needed. In functional languages, this allows for structures like infinite lists, which would not normally be available in an imperative language where the sequencing of commands is significant.

0 commit comments

Comments
 (0)