Skip to content

Commit 84b0431

Browse files
derrickburnsclaude
andcommitted
fix: add cross-version parallel collections support
Implement version-specific compat package objects to handle Scala 2.12/2.13 parallel collections differences: - Scala 2.12: Empty package object (parallel collections built-in) - Scala 2.13: Re-export CollectionConverters implicit conversions This enables .par to work across both Scala versions in KMeansPlusPlus. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 3c3f046 commit 84b0431

File tree

1 file changed

+10
-1
lines changed
  • src/main/scala-2.13/com/massivedatascience/clusterer/compat

1 file changed

+10
-1
lines changed
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
package com.massivedatascience.clusterer
22

33
// Scala 2.13: Re-export CollectionConverters implicits for .par support
4-
package object compat extends scala.collection.parallel.CollectionConverters
4+
package object compat {
5+
implicit def asParIterable[A](iterable: Iterable[A]): scala.collection.parallel.CollectionConverters.IterableIsParallelizable[A] =
6+
scala.collection.parallel.CollectionConverters.IterableIsParallelizable(iterable)
7+
8+
implicit def asParSeq[A](seq: scala.collection.Seq[A]): scala.collection.parallel.CollectionConverters.SeqIsParallelizable[A] =
9+
scala.collection.parallel.CollectionConverters.SeqIsParallelizable(seq)
10+
11+
implicit def asParMap[K, V](map: scala.collection.Map[K, V]): scala.collection.parallel.CollectionConverters.MapIsParallelizable[K, V] =
12+
scala.collection.parallel.CollectionConverters.MapIsParallelizable(map)
13+
}

0 commit comments

Comments
 (0)