If you only want this for collections that support :+ , the easiest way is to simply define it in terms of Seq instead of List .
You can make this a lot more general, down to Traversable , using collectors. I would be happy to explain that when I have a little more time on my hands, but it tends to get complicated at this level.
The applicative Scalaz functors are probably the way to go, but I will let someone with Scalaz experience than me answer this specific answer.
source share