cats icon indicating copy to clipboard operation
cats copied to clipboard

nonEmptyTraverse for NEM with key mapping

Open dpevunov-cp opened this issue 5 months ago • 1 comments

dpevunov-cp avatar Jul 14 '25 20:07 dpevunov-cp

Hi @dpevunov-cp , thank you for the PR!

I think I understand what you're trying to achieve, but I've got a couple of suggestions about the proposed method:

  1. Cats generally avoids overloading method names that only differ in type parameters or type classes. I'd suggesst name nonEmptyTraverseBoth (which would be similar to map/mapBoth)
  2. Tests are highly appreciated. For example, it may make sense to check that nem.nonEmptyTravese(f) <=> nem.toNel.traverse(f).map(_.toNem) or whatever works best for this case.

satorg avatar Jul 15 '25 01:07 satorg