Last active
February 6, 2018 16:28
-
-
Save dinocarl/0aa0dca724327ff4f8b546a31dde9b43 to your computer and use it in GitHub Desktop.
Extracting a value from a Sanctuary JS Maybe
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 words = [] | |
R.compose( | |
S.toUpper, | |
S.fromMaybe('x'), | |
S.head | |
)(words) | |
// or | |
S.toUpper(S.fromMaybe('x', S.head(words))) | |
// longer example | |
// https://goo.gl/mi739S |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment