On 11/11/16 1:37 AM, ace_coder wrote:
However when I declare it's usage within another monad I get a type error.

trait Foo[ F[ _ ], +A, +B] {
  def getFoo(): F[A \/ B]
}

The above code throws a compile-time error regarding type parameters A and B being covariant types at invariant positions, but I thought scalaz.\/ is defined with covariant types.

Yes, I described this problem in "The missing diamond of Scala variance" <https://failex.blogspot.com/2016/09/the-missing-diamond-of-scala-variance.html#markdown-header-whence-monad-transformer-variance> (video from 17:02 <https://youtu.be/h4LzUkYQGyE?t=17m2s>, might be a little clearer explanation for your purposes). Unfortunately, without the "variance variables" described therein, while you can mark F as F[+_], as Scalaz used to, this will restrict you to F-monads that are themselves marked covariant.

--
Stephen Compall

--
You received this message because you are subscribed to the Google Groups 
"scalaz" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to scalaz+unsubscr...@googlegroups.com.
To post to this group, send email to scalaz@googlegroups.com.
Visit this group at https://groups.google.com/group/scalaz.
For more options, visit https://groups.google.com/d/optout.

Reply via email to