Conversation
d46f027 to
b3cd30a
Compare
Current coverage is
|
|
|
||
| def exists(f: B => Boolean)(implicit F: Functor[F]): F[Boolean] = F.map(value)(_.exists(f)) | ||
|
|
||
| def ensure[AA >: A](ifLeft: => AA)(f: B => Boolean)(implicit F: Functor[F]): XorT[F, AA, B] = XorT(F.map(value)(_.ensure(ifLeft)(f))) |
There was a problem hiding this comment.
The name ifLeft surprised me. This is the value that is used if the input is a Right but the predicate fails, right? I see that you are just following the name used in Xor, but I'm thinking we should probably change both of these to ifFalse, whenFalse, predicateFailed or something like that. What do you think?
There was a problem hiding this comment.
Well, in case of predicate falling the whole XorT "falls" to the left branch, it might be an explanation :)
But no problem, I could rename both.
|
Thanks, @imliar! I like this. I left one minor comment and am interested in your thoughts on it. |
b3cd30a to
c4b4134
Compare
|
@ceedubs Done |
|
@imliar great, thanks! 👍 Are people happy with |
|
👍 |
#926