Created
August 30, 2018 08:47
-
-
Save e-mihaylin/5285503fdb216ffe607ebbd8078cc9fc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const makeNumber = (n, f) => f ? f(n) : n; | |
| const zero = f => makeNumber(0, f); | |
| const one = f => makeNumber(1, f); | |
| const two = f => makeNumber(2, f); | |
| const three = f => makeNumber(3, f); | |
| const four = f => makeNumber(4, f); | |
| const five = f => makeNumber(5, f); | |
| const six = f => makeNumber(6, f); | |
| const seven = f => makeNumber(7, f); | |
| const eight = f => makeNumber(8, f); | |
| const nine = f => makeNumber(9, f); | |
| const plus = b => a => a + b; | |
| const minus = b => a => a - b; | |
| const times = b => a => a * b; | |
| const dividedBy = b => a => a / b; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment