Skip to content

Instantly share code, notes, and snippets.

@songpp
Created January 24, 2013 10:18
Show Gist options
  • Select an option

  • Save songpp/4619619 to your computer and use it in GitHub Desktop.

Select an option

Save songpp/4619619 to your computer and use it in GitHub Desktop.
Higher Rank existential types
package sun.flower.higher
/**
*
* User: sunflower
* Date: 13-1-20
* Time: 下午11:44
*
*/
object HigherRankPolymorphism {
trait ~>[F[_],G[_]]{
def apply[A](a : F[A]) : G[A]
}
type Id[A] = A
def apply[B](f: Id ~> List,b : B,s : String ) : (List[B],List[String]) = (f(b):List[B], f(s))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment