any simple solution?
Yeah. I suppose you can abstract some simple cases. map can be abstracted using Functor filter and collect can be abstracted using FunctorFilter ++, concat can be abstracted using MonoidK single, fromSeq can be abstracted using Applicative and MonoidK All of those are allready part of mentioned cats library and have sence for scala collections as well for RDDs Then you can write more scala code and think of more interesting abstractions for your tasks
But in order to use typeclasses in your app effectively you need to practice more. One way is to do some exercices https://www.scala-exercises.org/cats/semigroup
Обсуждают сегодня