Created
August 30, 2018 13:16
-
-
Save IsTheJack/1b7c5f15b1ca89e92fde5a84e516f4da to your computer and use it in GitHub Desktop.
Dado o código. Para obter o resultado de saída esperado (linha 13), qual método de composição eu devo utilizar no lugar da função 'X' (linha 11)? Opções (compose e pipe)
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
import { compose, pipe } from 'ramda' | |
const ada = { name: 'Ada Lovelace', age: 36 } | |
// getNameProp :: Object -> String | |
const getNameProp = obj => obj.name | |
// toThank :: String -> String | |
const toThank = name => `Thank you, ${name}!` | |
const toThankPerson = X(toThank, getNameProp) | |
console.log(toThankPerson(ada)) // => Thank you, Ada Lovelace! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment