Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Implementation of hsequence and zip for Monads
def hsequence[M[_], In <: HList, Out <: HList](l: In)(implicit ev: IsHListOfM[M, In, Out], m: Monad[M]) = ev.hsequence(l)
def zip[M[_], P <: Product, In <: HList, Out <: HList]
(p: P)
(implicit gen: Generic.Aux[P, In], ev: IsHListOfM[M, In, Out], tupler: Tupler[Out], m: Monad[M]) = {
m.map(hsequence(gen.to(p)))(_.tupled)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.