@@ -14,10 +14,20 @@ trait PrimitiveStreamUnboxer[A, S] {
1414 def apply (boxed : Stream [A ]): S
1515}
1616
17- trait Priority5StreamConverters {
17+ trait Priority3StreamConverters {
18+ implicit class EnrichAnySteppableWithParStream [A , CC ](cc : CC )(implicit steppize : CC => MakesStepper [AnyStepper [A ] with EfficientSubstep ])
19+ extends MakesParallelStream [A , Stream [A ]] {
20+ def parStream : Stream [A ] = StreamSupport .stream(steppize(cc).stepper.anticipateParallelism, true )
21+ }
22+ implicit class EnrichAnyKeySteppableWithParKeyStream [K , CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [AnyStepper [K ] with EfficientSubstep ]) {
23+ def parKeyStream : Stream [K ] = StreamSupport .stream(steppize(cc).keyStepper.anticipateParallelism, true )
24+ }
25+ implicit class EnrichAnyValueSteppableWithParValueStream [V , CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [AnyStepper [V ] with EfficientSubstep ]) {
26+ def parValueStream : Stream [V ] = StreamSupport .stream(steppize(cc).valueStepper.anticipateParallelism, true )
27+ }
1828 // Note--conversion is only to make sure implicit conversion priority is lower than alternatives.
1929 implicit class EnrichScalaCollectionWithSeqStream [A , CC ](cc : CC )(implicit steppize : CC => MakesStepper [AnyStepper [A ]])
20- extends MakesSequentialStream [A , Stream [A ]] {
30+ extends MakesSequentialStream [A , Stream [A ]] {
2131 def seqStream : Stream [A ] = StreamSupport .stream(steppize(cc).stepper, false )
2232 }
2333 implicit class EnrichScalaCollectionWithKeySeqStream [K , CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [AnyStepper [K ]]) {
@@ -28,94 +38,66 @@ trait Priority5StreamConverters {
2838 }
2939}
3040
31- trait Priority4StreamConverters extends Priority5StreamConverters {
41+ trait Priority2StreamConverters extends Priority3StreamConverters {
42+ implicit class EnrichDoubleSteppableWithParStream [CC ](cc : CC )(implicit steppize : CC => MakesStepper [DoubleStepper with EfficientSubstep ])
43+ extends MakesParallelStream [java.lang.Double , DoubleStream ] {
44+ def parStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).stepper.anticipateParallelism, true )
45+ }
46+ implicit class EnrichDoubleKeySteppableWithParKeyStream [CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [DoubleStepper with EfficientSubstep ]) {
47+ def parKeyStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).keyStepper.anticipateParallelism, true )
48+ }
49+ implicit class EnrichDoubleValueSteppableWithParValueStream [CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [DoubleStepper with EfficientSubstep ]) {
50+ def parValueStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).valueStepper.anticipateParallelism, true )
51+ }
52+ implicit class EnrichIntSteppableWithParStream [CC ](cc : CC )(implicit steppize : CC => MakesStepper [IntStepper with EfficientSubstep ])
53+ extends MakesParallelStream [java.lang.Integer , IntStream ] {
54+ def parStream : IntStream = StreamSupport .intStream(steppize(cc).stepper.anticipateParallelism, true )
55+ }
56+ implicit class EnrichIntKeySteppableWithParKeyStream [CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [IntStepper with EfficientSubstep ]) {
57+ def parKeyStream : IntStream = StreamSupport .intStream(steppize(cc).keyStepper.anticipateParallelism, true )
58+ }
59+ implicit class EnrichIntValueSteppableWithParValueStream [CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [IntStepper with EfficientSubstep ]) {
60+ def parValueStream : IntStream = StreamSupport .intStream(steppize(cc).valueStepper.anticipateParallelism, true )
61+ }
62+ implicit class EnrichLongSteppableWithParStream [CC ](cc : CC )(implicit steppize : CC => MakesStepper [LongStepper with EfficientSubstep ])
63+ extends MakesParallelStream [java.lang.Long , LongStream ] {
64+ def parStream : LongStream = StreamSupport .longStream(steppize(cc).stepper.anticipateParallelism, true )
65+ }
66+ implicit class EnrichLongKeySteppableWithParKeyStream [CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [LongStepper with EfficientSubstep ]) {
67+ def parKeyStream : LongStream = StreamSupport .longStream(steppize(cc).keyStepper.anticipateParallelism, true )
68+ }
69+ implicit class EnrichLongValueSteppableWithParValueStream [CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [LongStepper with EfficientSubstep ]) {
70+ def parValueStream : LongStream = StreamSupport .longStream(steppize(cc).valueStepper.anticipateParallelism, true )
71+ }
3272 implicit class EnrichScalaCollectionWithSeqDoubleStream [CC ](cc : CC )(implicit steppize : CC => MakesStepper [DoubleStepper ])
33- extends MakesSequentialStream [java.lang.Double , DoubleStream ] {
73+ extends MakesSequentialStream [java.lang.Double , DoubleStream ] {
3474 def seqStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).stepper, false )
35- }
75+ }
3676 implicit class EnrichScalaCollectionWithSeqIntStream [CC ](cc : CC )(implicit steppize : CC => MakesStepper [IntStepper ])
37- extends MakesSequentialStream [java.lang.Integer , IntStream ] {
77+ extends MakesSequentialStream [java.lang.Integer , IntStream ] {
3878 def seqStream : IntStream = StreamSupport .intStream(steppize(cc).stepper, false )
39- }
79+ }
4080 implicit class EnrichScalaCollectionWithSeqLongStream [CC ](cc : CC )(implicit steppize : CC => MakesStepper [LongStepper ])
41- extends MakesSequentialStream [java.lang.Long , LongStream ] {
81+ extends MakesSequentialStream [java.lang.Long , LongStream ] {
4282 def seqStream : LongStream = StreamSupport .longStream(steppize(cc).stepper, false )
4383 }
4484 implicit class EnrichScalaCollectionWithSeqDoubleKeyStream [CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [DoubleStepper ]) {
4585 def seqKeyStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).keyStepper, false )
46- }
86+ }
4787 implicit class EnrichScalaCollectionWithSeqIntKeyStream [CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [IntStepper ]) {
4888 def seqKeyStream : IntStream = StreamSupport .intStream(steppize(cc).keyStepper, false )
49- }
89+ }
5090 implicit class EnrichScalaCollectionWithSeqLongKeyStream [CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [LongStepper ]) {
5191 def seqKeyStream : LongStream = StreamSupport .longStream(steppize(cc).keyStepper, false )
5292 }
5393 implicit class EnrichScalaCollectionWithSeqDoubleValueStream [CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [DoubleStepper ]) {
5494 def seqValueStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).valueStepper, false )
55- }
56- implicit class EnrichScalaCollectionWithSeqIntValueStream [CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [IntStepper ]) {
57- def seqValueStream : IntStream = StreamSupport .intStream(steppize(cc).valueStepper, false )
58- }
59- implicit class EnrichScalaCollectionWithSeqLongValueStream [CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [LongStepper ]) {
60- def seqValueStream : LongStream = StreamSupport .longStream(steppize(cc).valueStepper, false )
61- }
62- }
63-
64- trait Priority3StreamConverters extends Priority4StreamConverters {
65- implicit class EnrichAnySteppableWithStream [A , CC ](cc : CC )(implicit steppize : CC => MakesStepper [AnyStepper [A ] with EfficientSubstep ])
66- extends MakesSequentialStream [A , Stream [A ]] with MakesParallelStream [A , Stream [A ]] {
67- def seqStream : Stream [A ] = StreamSupport .stream(steppize(cc).stepper, false )
68- def parStream : Stream [A ] = StreamSupport .stream(steppize(cc).stepper.anticipateParallelism, true )
69- }
70- implicit class EnrichAnyKeySteppableWithStream [K , CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [AnyStepper [K ] with EfficientSubstep ]) {
71- def seqKeyStream : Stream [K ] = StreamSupport .stream(steppize(cc).keyStepper, false )
72- def parKeyStream : Stream [K ] = StreamSupport .stream(steppize(cc).keyStepper.anticipateParallelism, true )
73- }
74- implicit class EnrichAnyValueSteppableWithStream [V , CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [AnyStepper [V ] with EfficientSubstep ]) {
75- def seqValueStream : Stream [V ] = StreamSupport .stream(steppize(cc).valueStepper, false )
76- def parValueStream : Stream [V ] = StreamSupport .stream(steppize(cc).valueStepper.anticipateParallelism, true )
77- }
78- }
79-
80- trait Priority2StreamConverters extends Priority3StreamConverters {
81- implicit class EnrichDoubleSteppableWithStream [CC ](cc : CC )(implicit steppize : CC => MakesStepper [DoubleStepper with EfficientSubstep ])
82- extends MakesSequentialStream [java.lang.Double , DoubleStream ] with MakesParallelStream [java.lang.Double , DoubleStream ] {
83- def seqStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).stepper, false )
84- def parStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).stepper.anticipateParallelism, true )
85- }
86- implicit class EnrichDoubleKeySteppableWithStream [CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [DoubleStepper with EfficientSubstep ]) {
87- def seqKeyStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).keyStepper, false )
88- def parKeyStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).keyStepper.anticipateParallelism, true )
89- }
90- implicit class EnrichDoubleValueSteppableWithStream [CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [DoubleStepper with EfficientSubstep ]) {
91- def seqValueStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).valueStepper, false )
92- def parValueStream : DoubleStream = StreamSupport .doubleStream(steppize(cc).valueStepper.anticipateParallelism, true )
9395 }
94- implicit class EnrichIntSteppableWithStream [CC ](cc : CC )(implicit steppize : CC => MakesStepper [IntStepper with EfficientSubstep ])
95- extends MakesSequentialStream [java.lang.Integer , IntStream ] with MakesParallelStream [java.lang.Integer , IntStream ] {
96- def seqStream : IntStream = StreamSupport .intStream(steppize(cc).stepper, false )
97- def parStream : IntStream = StreamSupport .intStream(steppize(cc).stepper.anticipateParallelism, true )
98- }
99- implicit class EnrichIntKeySteppableWithStream [CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [IntStepper with EfficientSubstep ]) {
100- def seqKeyStream : IntStream = StreamSupport .intStream(steppize(cc).keyStepper, false )
101- def parKeyStream : IntStream = StreamSupport .intStream(steppize(cc).keyStepper.anticipateParallelism, true )
102- }
103- implicit class EnrichIntValueSteppableWithStream [CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [IntStepper with EfficientSubstep ]) {
96+ implicit class EnrichScalaCollectionWithSeqIntValueStream [CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [IntStepper ]) {
10497 def seqValueStream : IntStream = StreamSupport .intStream(steppize(cc).valueStepper, false )
105- def parValueStream : IntStream = StreamSupport .intStream(steppize(cc).valueStepper.anticipateParallelism, true )
10698 }
107- implicit class EnrichLongSteppableWithStream [CC ](cc : CC )(implicit steppize : CC => MakesStepper [LongStepper with EfficientSubstep ])
108- extends MakesSequentialStream [java.lang.Long , LongStream ] with MakesParallelStream [java.lang.Long , LongStream ] {
109- def seqStream : LongStream = StreamSupport .longStream(steppize(cc).stepper, false )
110- def parStream : LongStream = StreamSupport .longStream(steppize(cc).stepper.anticipateParallelism, true )
111- }
112- implicit class EnrichLongKeySteppableWithStream [CC ](cc : CC )(implicit steppize : CC => MakesKeyStepper [LongStepper with EfficientSubstep ]) {
113- def seqKeyStream : LongStream = StreamSupport .longStream(steppize(cc).keyStepper, false )
114- def parKeyStream : LongStream = StreamSupport .longStream(steppize(cc).keyStepper.anticipateParallelism, true )
115- }
116- implicit class EnrichLongValueSteppableWithStream [CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [LongStepper with EfficientSubstep ]) {
99+ implicit class EnrichScalaCollectionWithSeqLongValueStream [CC ](cc : CC )(implicit steppize : CC => MakesValueStepper [LongStepper ]) {
117100 def seqValueStream : LongStream = StreamSupport .longStream(steppize(cc).valueStepper, false )
118- def parValueStream : LongStream = StreamSupport .longStream(steppize(cc).valueStepper.anticipateParallelism, true )
119101 }
120102}
121103
0 commit comments