0

It seems trivial to implement it on our own:

implicit def s[F[_]: Monad, A: Semigroup]: Semigroup[F[A]] = 
  Semigroup.instance((fa, fb) => for {
    fa <- fa
    fb <- fb
  } yield fa |+| fb)

But is it possible to derive it automatically? Kittens seems to work with case classes (at least I tried it for that case and it didn't work).

Some Name
  • 8,555
  • 5
  • 27
  • 77

0 Answers0