Skip to content

Instantly share code, notes, and snippets.

@paulp
Created September 1, 2014 16:04
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save paulp/dcfcd587b9a682dd6d6b to your computer and use it in GitHub Desktop.
Save paulp/dcfcd587b9a682dd6d6b to your computer and use it in GitHub Desktop.
trait RankN {
type TransformRank1[CC[X]] = CC ~> CC
type TransformRank0[CC[X]] = CC[_] => CC[_]
def liftRank[CC[X]](f: TransformRank0[CC]): TransformRank1[CC] =
new TransformRank1[CC] {
def apply[A](x: CC[A]): CC[A] = f(x).castTo[CC[A]]
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment