Different Behavior with (Cats) Functor in Scala-REPL and Compilation

import cats.{Functor, Monoid}trait Fold[I, O] { type M def m: Monoid[M] def tally: I => M def summarize: M => O}object Fold { def apply[I, O, _M](_m: Monoid[_M])(_tally: I => _M, _summarize: _M => O): Fold[I, O] = new Fold[I, O] { override type M = _M override def m = _m override def tally = _tally override def summarize = _summarize }}object BeautifulFold extends App { def fold[I, O](input: Seq[I])(f: Fold[I, O]): O = f.summarize(input.foldLeft(f.m.empty)((x, y) => f.m.combine(x, f.tally(y)))) def sum[M](...Read more