ScalaTrie

An immutable and purely functional Trie class written in Scala.

Usage

Add the library to build.sbt dependencies:

libraryDependencies += "io.github.mattjp" %% "scalatrie" % "1.0.1"

Add the library to Scala code:

import trie.Trie

val trie: Trie =  Trie().addMany(Seq("trie", "tree"))

trie.validWord("trie") // true
trie.validWord("tr")   // false
trie.validPrefix("tr") // true
trie.getSuffixes("tr") // ["ie", "ee"]

val updatedTrie: Trie = trie.remove("tree")

Publishing

  1. Update ~/.sbt/sonatype_credentials with proper publishing credentials.
  2. version in build.sbt should not include the -SNAPSHOT suffix.
  3. Run sbt publishSigned.
  4. Navigate to the Nexus staging repositories page: https://s01.oss.sonatype.org/#stagingRepositories (login with Sonatype credentials).
  5. Close the staging repository through the console.
  6. Release the staging repository through the console.