All Downloads are FREE. Search and download functionalities are using the official Maven repository.

generated.SchematicGenArity.scala Maven / Gradle / Ivy

There is a newer version: 0.12.16
Show newest version
/*
 *  Copyright 2021 Disney Streaming
 *
 *  Licensed under the Tomorrow Open Source Technology License, Version 1.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *     https://disneystreaming.github.io/TOST-1.0.txt
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package schematic
package scalacheck

import org.scalacheck.Gen

trait SchematicGenArity extends struct.Schematic[Gen] {

  protected def genField[S, A](field: Field[Gen, S, A]): Gen[A] = Gen.lzy(field.instanceA {
    new Field.ToOptional[Gen] { def apply[AA](genA: Gen[AA]) : Gen[Option[AA]] = Gen.option(genA) }
  })

  def struct[Z, A0](a0: Field[Gen, Z, A0])(f: (A0) => Z): Gen[Z] = Gen.zip(genField(a0)).map(f)
  def struct[Z, A0, A1](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1])(f: (A0, A1) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1)).map(f.tupled)
  def struct[Z, A0, A1, A2](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2])(f: (A0, A1, A2) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3])(f: (A0, A1, A2, A3) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4])(f: (A0, A1, A2, A3, A4) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5])(f: (A0, A1, A2, A3, A4, A5) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6])(f: (A0, A1, A2, A3, A4, A5, A6) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7])(f: (A0, A1, A2, A3, A4, A5, A6, A7) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10], a11: Field[Gen, Z, A11])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10), genField(a11)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10], a11: Field[Gen, Z, A11], a12: Field[Gen, Z, A12])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10), genField(a11), genField(a12)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10], a11: Field[Gen, Z, A11], a12: Field[Gen, Z, A12], a13: Field[Gen, Z, A13])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10), genField(a11), genField(a12), genField(a13)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10], a11: Field[Gen, Z, A11], a12: Field[Gen, Z, A12], a13: Field[Gen, Z, A13], a14: Field[Gen, Z, A14])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10), genField(a11), genField(a12), genField(a13), genField(a14)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10], a11: Field[Gen, Z, A11], a12: Field[Gen, Z, A12], a13: Field[Gen, Z, A13], a14: Field[Gen, Z, A14], a15: Field[Gen, Z, A15])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10), genField(a11), genField(a12), genField(a13), genField(a14), genField(a15)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10], a11: Field[Gen, Z, A11], a12: Field[Gen, Z, A12], a13: Field[Gen, Z, A13], a14: Field[Gen, Z, A14], a15: Field[Gen, Z, A15], a16: Field[Gen, Z, A16])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10), genField(a11), genField(a12), genField(a13), genField(a14), genField(a15), genField(a16)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10], a11: Field[Gen, Z, A11], a12: Field[Gen, Z, A12], a13: Field[Gen, Z, A13], a14: Field[Gen, Z, A14], a15: Field[Gen, Z, A15], a16: Field[Gen, Z, A16], a17: Field[Gen, Z, A17])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10), genField(a11), genField(a12), genField(a13), genField(a14), genField(a15), genField(a16), genField(a17)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10], a11: Field[Gen, Z, A11], a12: Field[Gen, Z, A12], a13: Field[Gen, Z, A13], a14: Field[Gen, Z, A14], a15: Field[Gen, Z, A15], a16: Field[Gen, Z, A16], a17: Field[Gen, Z, A17], a18: Field[Gen, Z, A18])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10), genField(a11), genField(a12), genField(a13), genField(a14), genField(a15), genField(a16), genField(a17), genField(a18)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10], a11: Field[Gen, Z, A11], a12: Field[Gen, Z, A12], a13: Field[Gen, Z, A13], a14: Field[Gen, Z, A14], a15: Field[Gen, Z, A15], a16: Field[Gen, Z, A16], a17: Field[Gen, Z, A17], a18: Field[Gen, Z, A18], a19: Field[Gen, Z, A19])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10), genField(a11), genField(a12), genField(a13), genField(a14), genField(a15), genField(a16), genField(a17), genField(a18), genField(a19)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10], a11: Field[Gen, Z, A11], a12: Field[Gen, Z, A12], a13: Field[Gen, Z, A13], a14: Field[Gen, Z, A14], a15: Field[Gen, Z, A15], a16: Field[Gen, Z, A16], a17: Field[Gen, Z, A17], a18: Field[Gen, Z, A18], a19: Field[Gen, Z, A19], a20: Field[Gen, Z, A20])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10), genField(a11), genField(a12), genField(a13), genField(a14), genField(a15), genField(a16), genField(a17), genField(a18), genField(a19), genField(a20)).map(f.tupled)
  def struct[Z, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21](a0: Field[Gen, Z, A0], a1: Field[Gen, Z, A1], a2: Field[Gen, Z, A2], a3: Field[Gen, Z, A3], a4: Field[Gen, Z, A4], a5: Field[Gen, Z, A5], a6: Field[Gen, Z, A6], a7: Field[Gen, Z, A7], a8: Field[Gen, Z, A8], a9: Field[Gen, Z, A9], a10: Field[Gen, Z, A10], a11: Field[Gen, Z, A11], a12: Field[Gen, Z, A12], a13: Field[Gen, Z, A13], a14: Field[Gen, Z, A14], a15: Field[Gen, Z, A15], a16: Field[Gen, Z, A16], a17: Field[Gen, Z, A17], a18: Field[Gen, Z, A18], a19: Field[Gen, Z, A19], a20: Field[Gen, Z, A20], a21: Field[Gen, Z, A21])(f: (A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) => Z): Gen[Z] = Gen.zip(genField(a0), genField(a1), genField(a2), genField(a3), genField(a4), genField(a5), genField(a6), genField(a7), genField(a8), genField(a9), genField(a10), genField(a11), genField(a12), genField(a13), genField(a14), genField(a15), genField(a16), genField(a17), genField(a18), genField(a19), genField(a20), genField(a21)).map(f.tupled)

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy