These are chat archives for ramda/ramda

Apr 2018
Scott Sauyet
Apr 04 2018 00:43
@laxmike: These days, I don't think we'd even include it. It's just too easy to use lambdas for this.
Apr 04 2018 04:24

// get :: String -> Object -> Maybe *
var get = R.curry((propName, obj) => Maybe(obj[propName]))

// getStateCode :: Maybe String -> Maybe String
var getStateCode = R.composeK(
R.compose(Maybe.of, R.toUpper),
getStateCode({"user":{"address":{"state":"ny"}}}); //=> Maybe.Just("NY")
getStateCode({}); //=> Maybe.Nothing()

Which Maybe library should I choose?

Jacob Madsen
Apr 04 2018 11:13
Which TypeScript package should I use? types/npm-ramda#dist or @types/ramda ?
Apr 04 2018 11:26
@lizhoulee R.path(['user', 'address', 'state'])
Brad Compton (he/him)
Apr 04 2018 15:26
@lizhoulee I've used Sanctuary and Folktale. Sanctuary is much more opinionated, and works really well if you want the ADTs along with utility functions, and a run time type system that's on by default. If you're just looking for a Maybe implementation I've used folktale quite a bit and I like it. I think crocks is also worth checking out, but I haven't had a chance to try it out yet.
Apr 04 2018 16:12
@arbaaz @Bradcomp thank you !