typelevel / mouse

A small companion to cats
MIT License
368 stars 66 forks source link

Add `mapOrKeepIn` / `flatMapOrKeepIn` to `F[Option[A]]` and `F[Either[A,B]]` syntaxes #501

Closed danicheg closed 3 months ago

danicheg commented 3 months ago

These are counterpart methods to newly shipped Functor#mapOrKeep and Monad#flatMapOrKeep methods in Cats. From my tastes, mapOrKeepIn might be highly useful while flatMapOrKeepIn is not as much as the former. But I still decided to add it too and have complete conformity with Cats.

danicheg commented 3 months ago

Hey @benhutchison, no hurry at all, just mentioning you to make this PR more visible for review. Thanks!

danicheg commented 3 months ago

Alright. Changes are isolated, and it's merely four auxiliary methods affecting a few syntaxes. So, I'm merging this and will wait a week before releasing it to see if anyone expresses interest in propagating any related changes.

benhutchison commented 3 months ago

Apologies for missing this @danicheg 🙏

I need to de-noise my inbox so I don't miss these.

danicheg commented 3 months ago

@benhutchison No worries, you owe nothing! It's FOSS.