Skip to content

Commit b443657

Browse files
committed
added definition for Total Function #222
1 parent 6797f89 commit b443657

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ __Table of Contents__
7676
* [Function](#function)
7777
* [Partial function](#partial-function)
7878
* [Dealing with partial functions](#dealing-with-partial-functions)
79+
* [Total Function](#total-function)
7980
* [Functional Programming Libraries in JavaScript](#functional-programming-libraries-in-javascript)
8081

8182

@@ -1118,6 +1119,10 @@ times(-1)(console.log)
11181119
```
11191120
Making your partial functions total ones, these kinds of runtime errors can be prevented. Always returning a value will also make for code that is both easier to maintain as well as to reason about.
11201121

1122+
## Total Function
1123+
1124+
A function which returns a valid result for all inputs defined in its type. This is as opposed to [Partial Functions](#partial-function) which may throw an error, return an unexpected result, or fail to terminate.
1125+
11211126
## Functional Programming Libraries in JavaScript
11221127

11231128
* [mori](https://github.com/swannodette/mori)

0 commit comments

Comments
 (0)