Created
May 21, 2017 13:29
-
-
Save huijari/e790332a7ad344163fa5ce418c7c2d28 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 Just = value => ({ | |
bind: f => f(value) | |
}); | |
const Nothing = () => ({ | |
bind: Nothing | |
}); | |
const getUser = name => Just({ | |
getPicture: () => Nothing() | |
}); | |
const userM = getUser(); | |
userM | |
.bind(user => user.getPicture()) | |
.bind(picture => picture.getUrl()) | |
.bind(console.log.bind(console)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment