Skip to content

Instantly share code, notes, and snippets.

View banshee's full-sized avatar

James Moore banshee

View GitHub Profile
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))
}
}