package com.vpai.dsl.eff.main import org.atnos.eff._ import org.atnos.eff.either._ import Except._ object DSLUser { // The effect stack we use type PrgType = Fx.fx2[ Except, Either[Throwable, ?], ] // Our "program" def program[R : _except : _ThrowableEither]: Eff[R, Int] = for { // This catchLeft never works (does call handle parameter) v <- catchLeft(raiseException(10)) { t: Throwable => t match { case _ => { println("Exception caught") Eff .pure(0) } } } } yield v def main(args: Array[String]): Unit = { import syntax.all._ // Run the program // Expected that it will print "Exception caught" // Actual: Doesn't print anything at all program[PrgType].runExcept.runEither.run } }