An immutable and purely functional Trie class written in Scala.
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")
- Update
~/.sbt/sonatype_credentials
with proper publishing credentials. version
inbuild.sbt
should not include the-SNAPSHOT
suffix.- Run
sbt publishSigned
. - Navigate to the Nexus staging repositories page: https://s01.oss.sonatype.org/#stagingRepositories (login with Sonatype credentials).
- Close the staging repository through the console.
- Release the staging repository through the console.