Skip to content

Instantly share code, notes, and snippets.

Last active Aug 29, 2015
What would you like to do?
Attempt to use kind-projector to support @mandubian's use case as presented here:
package xyz
import language.higherKinds
import scalaz._
import Scalaz._
import scala.concurrent.Future
// see for more info about what is going on here
object Test {
// consumes a type *
def type0[U]: Int = 0
// consumes a type * -> *
def type1[U[_]]: Int = 1
// OptionT part
type1[({ type L[B] = OptionT[Future, B] })#L]
type1[OptionT[Future, ?]]
// ListT part
type1[({ type M[A] = ListT[({ type L[+B] = OptionT[Future, B] })#L, A] })#M]
type1[({ type M[A] = ListT[Lambda[+[B] => OptionT[Future, B]], A] })#M]
type1[({ type M[A] = ListT[OptionT[Future, +?], A] })#M]
type1[Lambda[A => ListT[OptionT[Future, +?], A]]]
type1[ListT[OptionT[Future, +?], ?]]
// MonadPlus part
type0[MonadPlus[ListT[OptionT[Future, +?], ?]]]

This comment has been minimized.

Copy link
Owner Author

@non non commented Jun 6, 2014

I think this is the first "in-the-wild" use of the covariance/contravariance support I added awhile ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment