Is a Monad available only in "cats" package?

Hi all,

Due to a job related task, I would like to use a construnct of the type:

val list1 = Monad[List].pure(3)

To get a:

list1: List[Int] = List(3)

But actually, I can’t include any new package/class/framework to the project classpath, so my question is: abstraction like Monad, Functor, Semigroup, Monoid are only availeble with the “Cats” framework? Is possible to use an explicit “Monad” constructor from a standard scala library?

Thanks !

Monad is FP abstraction and therefore can be in other FP Scala libraries like ScalaZ for instance. But Scala standard library doesn’t contain Monad

2 Likes