Monad instance for EvalOption[A] in Scala

61 Views Asked by At

Imagine an EvalOption type defined as follows:

type EvalOption = [A] =>> Eval[Option[A]]

Is it possible to create an instance of Monad in such a way that the stack safety of Eval is maintained?

I was able to create an Applicative instance for such type, but I'm having problems implementing the flatMap method. So, if anyone knows way of doing this I would be very grateful .

Thanks, have a nice one!

0

There are 0 best solutions below