score:0
The radix sort invariant is that the data is sorted using the first k bits. If you want an operation that adds more data sorted or not, you are asking for merge sort functionality not radix. If what you are adding is bits of data to all records you could use a monoid.
Edit: The hart of a monoid is an associative operation. We can look at the sorting bits as a way of applying partial order. You injest the data for all records bit by bit. Each bit applies a partial order. This is associative you can merge some bits to get a more elaborate partial order. Note order is important but it is still associative.and thus can be.viewed as a monad
score:0
I think you may be thinking too literally about the idea of radix sort. Abstractly, I imagine the monoid you want is
- Sorted lists with
- Merging
The big question is how you want to represent the sorted lists. If you represent them as sorted Haskell lists, then the merge operation is the usual piece-by-piece merge used in merge sort. If you represent them in a more "radixy" fashion, then you'll have some variety of trie. You can probably find some algorithms around for merging tries. There's one in bytestring-trie
, but nothing about its implementation seems to be documented.
Source: stackoverflow.com
Related Query
- Can you formulate a monoid or semigroup for the radix sort?
- What are the precise rules for when you can omit parenthesis, dots, braces, = (functions), etc.?
- Can you specify type argument for None or tell compiler that it's an Option[String]?
- How can I fix the missing implicit value for parameter ta: TildeArrow in a test spec
- Can you recommend a good shared hosting provider for a webapp made with Lift framework with Scala?
- Scala: How can I install a package system wide for working with in the repl?
- How can I obtain the default value for a type in Scala?
- How do you print the select statements for the following Slick queries?
- Can you override the stream writers in scala @serializable objects?
- Can you sort a mutable Scala collection in place?
- Can you get a class name as a constant for scala annotations?
- Why does scalaz's implementation of Monoid for Option evaluate the f2 function twice?
- How can you get ScalaFX to play nice in the SBT console?
- How do you attach the Scala Intellij debugger for tests?
- Can you define a value (in a if) in a for comprehension in Scala for use in yield
- How can one change the location of the "webapp" directory for a Scalatra application?
- How to parse placeholders from text without throwing away your sword so you can fight off the marauders with a lampshade
- Can you declare parameter-less methods in Java for use in Scala?
- Should I use `()` or not for the method `getClients` when the return value can be changed?
- Can the Cake Pattern be used for non-singleton style dependencies?
- How can I get random data generated for scala case classes with the ability to "change some values" for unit testing?
- How can i make an SBT key see settings for the current configuration?
- In Eclipse, can I choose the version of Scala for my project?
- Can you make alias for another variable in scala?
- Can the incremental compiler in sbt be turned off for CI builds?
- How we can sort and group data from the Spark RDDs?
- Can you specify a view bound for an abstract type?
- What's the best way using Scala and SBT to create samples for a library that can be built from the SBT CLI?
- How can I use the Scala sttp FetchBackend for handling JavaScript in html?
- How can I create a generic list monoid in scala that maintains the inner type of the list involved?
More Query from same tag
- class needs to be abstract since its members are not instantiated
- AngularJS web client can't get resource from Scala Play server
- Scala Spark, compare two DataFrames and select the value of another column
- Scala Dynamic Parse Json using case class No Manifest available for T
- Produce Avro topic to Kafka using Apache Spark
- Is there a Scala pattern for collecting error messages from a sequence of independent computations?
- How to compose column name using another column's value for withColumn in Scala Spark
- Why future example do not work?
- Lift. MappedText vs MappedTextarea?
- How can I use scala generators to generate date with range?
- Chained Dataframe transformations in Scala with arguments and conditions
- Wrap method vs chain method
- Scala collections: transform content and type of the collection in one pass
- How to convert a Scala HTTP Route to a Java HTTP Route in Akka 2.4.7?
- How and where to add an sbteclipse task?
- Why is this Spring map not injecting into my Scala object?
- Splitting a list of strings into several lists at every predicate scala
- How to do recursive loops in scala
- How to migrate code from HasKeyValue to UnprefixedAttribute?
- How to retrieve the month from a date column values in scala dataframe?
- Is there scala compiler option that makes ` Option[T](t).map(x => null)` return None instead of Some(null)
- Add a compile time only dependency in sbt
- Will Scala 3 not be Turing complete?
- How can I get Spark SQL to import a Long without an "L" suffix?
- How to use from_json standard function with custom schema (error: overloaded method value from_json with alternative)?
- Apache Spark: transform timeseries data from one row per day into 24 X 1 hr rows
- Mapped Tables Column Type Conversion on Apply UnApply
- Play Framework 2 template Form None.get
- How to avoid: "blockingToByteString is a blocking and unsafe operation"
- Simple expression is reportedly recursive in parser combinators