sbt/util/collection/Types.scala

19 lines
413 B
Scala
Raw Normal View History

/* sbt -- Simple Build Tool
* Copyright 2010 Mark Harrah
*/
package sbt
2010-08-30 15:10:25 +02:00
object Types extends Types
{
implicit def hconsToK[M[_], H, T <: HList](h: M[H] :+: T)(implicit mt: T => KList[M, T]): KList[M, H :+: T] =
KCons[H, T, M](h.head, mt(h.tail) )
implicit def hnilToK(hnil: HNil): KNil = KNil
}
2010-08-30 15:10:25 +02:00
trait Types extends TypeFunctions
{
val :^: = KCons
val :+: = HCons
type :+:[H, T <: HList] = HCons[H,T]
}