When I looked at the source code of scalaz.effect.IO , I noticed that it has an apply method with the following signature:
sealed trait IO[A] { def apply(rw: Tower[IvoryTower]): Trampoline[(Tower[IvoryTower], A)] }
Tower[A] and IvoryTower defined as:
case class Tower[A]() sealed trait IvoryTower
There is one instance of Tower :
object IvoryTower extends IvoryTowers trait IvoryTowers { val ivoryTower = Tower[IvoryTower]() }
What is the purpose of these classes? Why IO.apply accept an argument of type Tower[IvoryTower] ?
scala io-monad scalaz
Zhekakozlov
source share