Пример #1
0
 @Override
 protected <T> List<T> fill(int n, Supplier<? extends T> s) {
   return List.fill(n, s);
 }
Пример #2
0
 /*
  * It's interesting that we never actually need to talk about the `RNG` value
  * in `sequence`. This is a strong hint that we could make this function
  * polymorphic in that type.
  */
 public static Rand<List<Integer>> ints(int count) {
   return sequence(List.fill(count, () -> intRnd));
 }