Skip to content

Commit daa11c4

Browse files
authored
Merge pull request #227 from hemanth/jethrolarson-total
added definition for Total Function #222
2 parents 6f9f88e + b443657 commit daa11c4

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

@@ -1140,6 +1141,10 @@ times(-1)(console.log)
11401141
```
11411142
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.
11421143

1144+
## Total Function
1145+
1146+
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.
1147+
11431148
## Functional Programming Libraries in JavaScript
11441149

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

0 commit comments

Comments
 (0)