2010-06-01 14:38:56 +02:00
|
|
|
/* sbt -- Simple Build Tool
|
|
|
|
|
* Copyright 2010 Mark Harrah
|
|
|
|
|
*/
|
2010-05-31 00:42:58 +02:00
|
|
|
package sbt
|
|
|
|
|
|
|
|
|
|
trait TypeFunctions
|
|
|
|
|
{
|
|
|
|
|
type Id[X] = X
|
|
|
|
|
trait Const[A] { type Apply[B] = A }
|
2010-05-31 03:14:18 +02:00
|
|
|
trait P1of2[M[_,_], A] { type Apply[B] = M[A,B] }
|
2010-05-31 00:42:58 +02:00
|
|
|
trait Down[M[_]] { type Apply[B] = Id[M[B]] }
|
|
|
|
|
|
2010-06-01 14:38:56 +02:00
|
|
|
trait ~>[-A[_], +B[_]]
|
2010-05-31 00:42:58 +02:00
|
|
|
{
|
|
|
|
|
def apply[T](a: A[T]): B[T]
|
|
|
|
|
}
|
|
|
|
|
def Id: Id ~> Id =
|
2010-06-01 14:38:56 +02:00
|
|
|
new (Id ~> Id) { def apply[T](a: T): T = a }
|
2010-05-31 00:42:58 +02:00
|
|
|
}
|
|
|
|
|
object TypeFunctions extends TypeFunctions
|