@@ -33,6 +33,7 @@ object Boilerplate {
3333 GenParallelArityFunctions2 ,
3434 GenFoldableArityFunctions ,
3535 GenFunctionSyntax ,
36+ GenFunctionSyntax2 ,
3637 GenTupleParallelSyntax ,
3738 GenTupleShowInstances ,
3839 GenTupleMonadInstances ,
@@ -624,9 +625,6 @@ object Boilerplate {
624625 |package cats
625626 |package syntax
626627 |
627- |import cats.Functor
628- |import cats.Semigroupal
629- |
630628 |trait FunctionApplySyntax {
631629 | implicit def catsSyntaxFunction1Apply[T, A0](f: Function1[A0, T]): Function1ApplyOps[T, A0] = new Function1ApplyOps(f)
632630 - implicit def catsSyntaxFunction ${arity}Apply[T, ${`A..N`}](f: $function): Function ${arity}ApplyOps[T, ${`A..N`}] = new Function ${arity}ApplyOps(f)
@@ -639,6 +637,36 @@ object Boilerplate {
639637 |
640638 -private[syntax] final class Function ${arity}ApplyOps[T, ${`A..N`}](private val f: $function) extends AnyVal with Serializable {
641639 - def liftN[F[_]: Functor: Semigroupal]( $typedParams): F[T] = Semigroupal.map $arity( ${`a..n`})(f)
640+ - private[syntax] def parLiftN[F[_]: Parallel]( $typedParams): F[T] = Parallel.parMap $arity( ${`a..n`})(f)
641+ -}
642+ """
643+ }
644+ }
645+
646+ object GenFunctionSyntax2 extends Template {
647+ def filename (root : File ) = root / " cats" / " syntax" / " FunctionApplySyntax2.scala"
648+
649+ override def range = 2 to maxArity
650+
651+ def content (tv : TemplateVals ) = {
652+ import tv ._
653+
654+ val function = s " Function $arity[ ${`A..N`}, T] "
655+
656+ val typedParams = synVals.zip(synTypes).map { case (v, t) => s " $v: F[ $t] " }.mkString(" , " )
657+
658+ // arity 1 left out intentionally, for it's part of GenFunctionSyntax already.
659+ // SyntaxSuite ensures that it exists.
660+
661+ block """
662+ |package cats
663+ |package syntax
664+ |
665+ |trait FunctionApplySyntax2 {
666+ - implicit def catsSyntaxFunction ${arity}Apply2[T, ${`A..N`}](f: $function): Function ${arity}ApplyOps2[T, ${`A..N`}] = new Function ${arity}ApplyOps2(f)
667+ |}
668+ |
669+ -private[syntax] final class Function ${arity}ApplyOps2[T, ${`A..N`}](private val f: $function) extends AnyVal with Serializable {
642670 - def parLiftN[F[_]: NonEmptyParallel]( $typedParams): F[T] = Parallel.parMap $arity( ${`a..n`})(f)
643671 -}
644672 """
0 commit comments