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
import scalaz._, Scalaz._, shapeless._, ops.hlist.{ RightFolder, Tupler } | |
// Might as well stay generic in `F` for this part. | |
object applicativeFolder extends Poly2 { | |
implicit def caseApplicative[A, B <: HList, F[_]](implicit | |
app: Applicative[F] | |
) = at[F[A], F[B]] { | |
(a, b) => app.ap(a)(app.map(b)(bb => (_: A) :: bb)) | |
} | |
} |