diff --git a/tasks/src/test/scala/DemoTask.scala b/tasks/src/test/scala/DemoTask.scala index 656abaa8a..9ebae6b8a 100644 --- a/tasks/src/test/scala/DemoTask.scala +++ b/tasks/src/test/scala/DemoTask.scala @@ -92,7 +92,8 @@ object Task def dependsOn(tasks: Task[_]*): Task[S] = new DependsOn(in, tasks) } - implicit val taskToNode = new (Task ~> NodeT[Task]#Apply) { + implicit val taskToNode = new NodeView[Task] { + def inline[T](a: Task[T]): Option[() => T] = None def apply[T](t: Task[T]): Node[Task, T] = t match { case Pure(eval) => toNode[T, HNil](KNil, _ => Right(eval()) ) case Mapped(in, f) => toNode(in, right ∙ f ) @@ -138,7 +139,6 @@ object Task def run[T](root: Task[T], checkCycles: Boolean, maxWorkers: Int): Result[T] = { val (service, shutdown) = CompletionService[Task[_], Completed](maxWorkers) - val x = new Execute[Task](checkCycles, Execute.noTriggers)(taskToNode) try { x.run(root)(service) } finally { shutdown() } } diff --git a/tasks/standard/src/test/scala/TaskSerial.scala b/tasks/standard/src/test/scala/TaskSerial.scala index 668c26241..c6da47dfa 100644 --- a/tasks/standard/src/test/scala/TaskSerial.scala +++ b/tasks/standard/src/test/scala/TaskSerial.scala @@ -67,7 +67,7 @@ object TaskTest { val (service, shutdown) = completionService[Task[_],Completed](restrictions, (x: String) => System.err.println(x)) - val x = new Execute[Task](checkCycles, Execute.noTriggers)(taskToNode) + val x = new Execute[Task](checkCycles, Execute.noTriggers)(taskToNode(idK[Task])) try { x.run(root)(service) } finally { shutdown() } } def tryRun[T](root: Task[T], checkCycles: Boolean, restrictions: ConcurrentRestrictions[Task[_]]): T = diff --git a/util/collection/TypeFunctions.scala b/util/collection/TypeFunctions.scala index 185c72226..bbfad9b8e 100644 --- a/util/collection/TypeFunctions.scala +++ b/util/collection/TypeFunctions.scala @@ -26,6 +26,7 @@ trait TypeFunctions implicit def toFn1[A,B](f: A => B): Fn1[A,B] = new Fn1[A,B] { def ∙[C](g: C => A) = f compose g } + def idK[M[_]]: M ~> M = new (M ~> M) { def apply[T](m: M[T]): M[T] = m } type Endo[T] = T=>T type ~>|[A[_],B[_]] = A ~> Compose[Option, B]#Apply