Skip to content

Instantly share code, notes, and snippets.

@rjhilgefort
Created November 10, 2017 16:55
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 rjhilgefort/7ed52affca8348023703d8250e1e503e to your computer and use it in GitHub Desktop.
Save rjhilgefort/7ed52affca8348023703d8250e1e503e to your computer and use it in GitHub Desktop.
// NOTE: Ramda repl
console.clear()
const foo = (a, b) => a + b
const bar = () => 4
const tryYolo = curry((func, params) => {
try {
return apply(func, params)
} catch (e) {}
})
console.log(
tryYolo(JSON.parse, ['{ "foo": "bar", "baz": 3 }']),
tryYolo(foo, [1, 2]),
tryYolo(bar, null)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment