aboutsummaryrefslogtreecommitdiff
path: root/core/lib/FiberTypes.scala
diff options
context:
space:
mode:
Diffstat (limited to 'core/lib/FiberTypes.scala')
-rw-r--r--core/lib/FiberTypes.scala19
1 files changed, 19 insertions, 0 deletions
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)]
+}