Created
August 20, 2013 18:00
-
-
Save stephenjudkins/6284917 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait HListContains[-H <: HList, A] { def apply(h: H):A } | |
implicit def headContains[A, T <: HList] = new HListContains[A :: T, A] { | |
def apply(h: A :: T) = h.head | |
} | |
implicit def tailContains[A, H, T <: HList](implicit tc: HListContains[T, A]) = new HListContains[H :: T, A] { | |
def apply(h: H :: T) = tc(h.tail) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment