Skip to content

Instantly share code, notes, and snippets.

@JesterXL
Created July 26, 2018 15:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JesterXL/2c74030258098f87beab7b2b2f70b0b4 to your computer and use it in GitHub Desktop.
Save JesterXL/2c74030258098f87beab7b2b2f70b0b4 to your computer and use it in GitHub Desktop.
const getName = get('name')
const setName = set('name')
const getFixedName = flow([getName, startCase])
const nameAndPerson = [{f: getFixedName}, {f: identity}]
const callF = invoker(1, 'f')
const flipMap = curry(rearg([1, 0], map))
const mapNameAndPerson = flipMap(nameAndPerson)
const getFixedNameAndPerson = flow([callF, mapNameAndPerson])
const setNameWithPersonNameAndPerson = apply(setName)
const mapFormatNames = flow([getFixedNameAndPerson, setNameWithPersonNameAndPerson])
const formatNames = map(mapFormatNames)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment