Last active
July 3, 2017 23:57
-
-
Save dewey92/5318f46f8d4e1e02646bb0e991ee3c57 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
| // getChild :: Person → Maybe Person | |
| const getChild = p => Maybe.of(p.child) | |
| // getAge :: Person → Maybe Number | |
| const getAge = p => Maybe.of(p.age) | |
| // safeDivisionBy :: Number → Number → Maybe Number | |
| const safeDivisionBy = bawah => atas => | |
| (bawah === 0) ? Nothing() : Maybe.of(atas / bawah) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment