Created
October 19, 2015 21:43
-
-
Save tomaszperek/6e06f8aa1cf63a54e0c2 to your computer and use it in GitHub Desktop.
Evidence for longer HLists
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
implicit def hconsIsHListOfM[M[_], H, In <: HList, Out <: HList]( | |
implicit ev: IsHListOfM[M, In, Out], m: Monad[M] | |
): IsHListOfM[M, M[H] :: In, H :: Out] = new IsHListOfM[M, M[H] :: In, H :: Out] { | |
override def hsequence(l: M[H] :: In): M[H :: Out] = | |
l.head.flatMap(h => ev.hsequence(l.tail).map(h :: _)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment