cats
cats copied to clipboard
nonEmptyTraverse for NEM with key mapping
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:
- Cats generally avoids overloading method names that only differ in type parameters or type classes. I'd suggesst name
nonEmptyTraverseBoth(which would be similar tomap/mapBoth) - 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.