aboutsummaryrefslogtreecommitdiff
path: root/tests/untried/pos/tcpoly_boundedmonad.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/untried/pos/tcpoly_boundedmonad.scala')
-rw-r--r--tests/untried/pos/tcpoly_boundedmonad.scala19
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/untried/pos/tcpoly_boundedmonad.scala b/tests/untried/pos/tcpoly_boundedmonad.scala
new file mode 100644
index 000000000..8c605dc7b
--- /dev/null
+++ b/tests/untried/pos/tcpoly_boundedmonad.scala
@@ -0,0 +1,19 @@
+trait Monad[T <: Bound[T], MyType[x <: Bound[x]], Bound[_]] {
+ def map[S <: Bound[S]](f: T => S): MyType[S]
+
+ def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_],
+ Result[x <: RBound[x]] <: Monad[x, RContainer, RBound]]
+ (f: T => Result[S]): Result[S]
+
+ def filter(p: T => Boolean): MyType[T]
+}
+
+class Set[T <: Ordered[T]] extends Monad[T, Set, Ordered] {
+ def map[S <: Ordered[S]](f: T => S): Set[S] = sys.error("TODO")
+
+ def flatMap[S <: RBound[S], RContainer[x <: RBound[x]], RBound[_],
+ Result[x <: RBound[x]] <: Monad[x, RContainer, RBound]]
+ (f: T => Result[S]): Result[S] = sys.error("TODO")
+
+ def filter(p: T => Boolean): Set[T] = sys.error("TODO")
+}