Jun. 11th, 2013

juan_gandhi: (VP)
src
def validate[F[_], G, H, V <: HList, I <: HList, M <: HList, A <: HList, R]
  (g: G)(v: V)(implicit
  hlG: FnHListerAux[G, A => R],
  zip: ZipApplyAux[V, I, M],
  mapped: MappedAux[A, F, M],
  unH: FnUnHListerAux[I => F[R], H],
  folder: LeftFolderAux[M, F[A => R], applier.type, F[HNil => R]],
  appl: Applicative[F]
) = unH((in: I) => folder(zip(v, in), hlG(g).point[F]).map(_(HNil)))


(скалу выучили, а как программировать, не выучили)

actually, it makes a lot of sense, like here:

val validateFoo = validate(Foo.apply _)(checkA :: checkB :: checkC :: HNil)

Profile

juan_gandhi: (Default)
Juan-Carlos Gandhi

October 2025

S M T W T F S
    1 23 4
5 678 9 1011
12 13 1415 161718
1920 2122 23 2425
26 2728 293031 

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags
Page generated Oct. 31st, 2025 09:51 am
Powered by Dreamwidth Studios