From 6b620da09b9f05699c1cf6080de229e63de47942 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Sun, 7 Jan 2018 21:51:22 +0100 Subject: Add initial code and project files. --- core/lib/FiberTypes.scala | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 core/lib/FiberTypes.scala (limited to 'core/lib/FiberTypes.scala') diff --git a/core/lib/FiberTypes.scala b/core/lib/FiberTypes.scala new file mode 100644 index 0000000..35f6a42 --- /dev/null +++ b/core/lib/FiberTypes.scala @@ -0,0 +1,19 @@ +package eu.mulk.fibers + +import scala.language.implicitConversions +import scala.util.continuations.cpsParam + +private[fibers] trait FiberTypes { + type Effect[_] + + /** + * Annotates a computation as a fiber. + * + * Annotate the return type of a fibrational function with this type + * annotator. + * + * @tparam Out the type of objects [[Fiber.emit]]ted by the fiber. + * @see [[Fiber.run]] + */ + type fiber[Out] = cpsParam[Any, (Effect[Out], Any ⇒ Any)] +} -- cgit v1.2.3