summaryrefslogtreecommitdiff
path: root/docs/examples/tcpoly/monads/Monads.scala
diff options
context:
space:
mode:
authorHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-11-02 14:34:35 +0000
committerHubert Plociniczak <hubert.plociniczak@epfl.ch>2011-11-02 14:34:35 +0000
commitb6778be91900b8161e705dc2598ef7af86842b0b (patch)
treed15e8ec18a37eec212f50f1ace27714d7e7d4d34 /docs/examples/tcpoly/monads/Monads.scala
parentac6c76f26d884a94d0c9ff54f055d3f9ab750bac (diff)
downloadscala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.gz
scala-b6778be91900b8161e705dc2598ef7af86842b0b.tar.bz2
scala-b6778be91900b8161e705dc2598ef7af86842b0b.zip
Begone t1737...
Diffstat (limited to 'docs/examples/tcpoly/monads/Monads.scala')
-rw-r--r--docs/examples/tcpoly/monads/Monads.scala14
1 files changed, 7 insertions, 7 deletions
diff --git a/docs/examples/tcpoly/monads/Monads.scala b/docs/examples/tcpoly/monads/Monads.scala
index 5a966ce960..b6e3d5b9a8 100644
--- a/docs/examples/tcpoly/monads/Monads.scala
+++ b/docs/examples/tcpoly/monads/Monads.scala
@@ -6,18 +6,18 @@ trait Monads {
* (>>=) :: m a -> (a -> m b) -> m b
* return :: a -> m a
*
- * MonadTC encodes the above Haskell type class,
+ * MonadTC encodes the above Haskell type class,
* an instance of MonadTC corresponds to a method dictionary.
* (see http://lampwww.epfl.ch/~odersky/talks/wg2.8-boston06.pdf)
*
* Note that the identity (`this') of the method dictionary does not really correspond
- * to the instance of m[x] (`self') that is `wrapped': e.g., unit does not use `self' (which
+ * to the instance of m[x] (`self') that is `wrapped': e.g., unit does not use `self' (which
* corresponds to the argument of the implicit conversion that encodes an instance of this type class)
*/
// Option =:= [x] => Option[x] <: [x] => Any
-// trait MonadTC[m <: [x] => Any, a] {
+// trait MonadTC[m <: [x] => Any, a] {
// MonadTC[m[x], a] x is a type parameter too -- should not write e.g., m[Int] here
- trait MonadTC[m[x], a] {
+ trait MonadTC[m[x], a] {
def unit[a](orig: a): m[a]
// >>='s first argument comes from the implicit definition constructing this "method dictionary"
@@ -32,7 +32,7 @@ trait Monads {
*/
trait OptionMonad extends Monads {
// this implicit method encodes the Monad type class instance for Option
- implicit def OptionInstOfMonad[a](self: Option[a]): MonadTC[Option, a]
+ implicit def OptionInstOfMonad[a](self: Option[a]): MonadTC[Option, a]
= new MonadTC[Option, a] {
def unit[a](orig: a) = Some(orig)
def >>=[b](fun: a => Option[b]): Option[b] = self match {
@@ -47,8 +47,8 @@ object main extends OptionMonad with Application {
}
-/*
-trait MonadTC[m[x], a] requires m[x] {
+/*
+trait MonadTC[m[x], a] requires m[x] {
def unit[a](orig: a): m[a]
// >>='s first argument comes from the implicit definition constructing this "method dictionary"