Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ジェネレーターの最大サイズを設定する例はたくさんありますが、最小長と最大長の間のリストを生成するにはどうすればよいですか?
A neat property about generators is they are composable, so you can simply compose a generator for the length of your list with a listOfN generator.
listOfN
for { numElems <- Gen.choose(5, 12) elems <- Gen.listOfN(numElems, elemGenerator) } yield elems