Scala and cats: Implicit conversion to identity monad
I have a function that computes sum of squares for numeric types as shown below. import cats.syntax.functor._ import cats.syntax.applicative._ import cats.{Id, Monad} import scala.language.higherKinds object PowerOfMonads { /** * Ultimate sum of squares method * * @param x First value in context * @param y Second value in context * @tparam F Monadic context * @tparam T Type parameter in the Monad * @return Sum of squares of first and second values in the Monadic context */ def sumOfSquares[F[_]: Monad, A, T >: A](x: F[A], y: F[A])(implicit num: Numeric[T]) : F[T] = { def square(value:T): T =