Created
April 14, 2020 17:25
-
-
Save UserGalileo/2aeda4a52fa752f6fb18b4dab92adf43 to your computer and use it in GitHub Desktop.
Composing Functions yielding monadic values
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
// These are our new elements | |
const f = x => Identity(x + 1); | |
const g = x => Identity(x + 2); | |
const h = x => Identity(x + 3); | |
// For now, let's just compose 2 of them. | |
const composed = f('a').chain(g); | |
// Identity(a12) | |
inspect(composed); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment