These are chat archives for ramda/ramda
Maybe.ofensures that you never get a
Just(null). But is that incorrect?
safethat take a value or predicate function to determine what instance is used (
Maybe.ofreturning either a
Yes, that's the same point. The fix is not hard, either. Just write another function (
safe, etc., or I've seen it simply called
maybe) that creates a
Just or a
Nothing the way your current
Maybe.of does it, and let
val => Just(val), even if
val is nil.
Then, for instance,
head == (arr) => maybe(arr) and you have a safe