kantan.codecs is a support library for the various kantan projects.
kantan.codecs is currently available for Scala 2.12 and 2.13.
The current version is
0.5.1, which can be added to your project with one or more of the following line(s)
in your SBT build file:
// Core library, included automatically if any other module is imported. libraryDependencies += "com.nrinaudo" %% "kantan.codecs" % "0.5.1" // Provides scalaz type class instances. libraryDependencies += "com.nrinaudo" %% "kantan.codecs-scalaz" % "0.5.1" // Provides cats type class instances. libraryDependencies += "com.nrinaudo" %% "kantan.codecs-cats" % "0.5.1"
Existing and planned kantan libraries are heavily encoding and decoding oriented - their main purpose is to turn raw data and decode it into useful types, or vice-versa. kantan.xpath, for instance, is all about turning the results of XPath expressions into types that can be more easily manipulated than strings or nodes.
Since all these libraries share the same underlying purpose, it’s only natural they should also share a lot of data
structures, or at least shapes of data structures. Both kantan.csv and
kantan.xpath, for example, define a
DecodeResult type which is essentially
kantan.codecs tries to unify these types and provide generic laws and tests for them, which both reduces code duplication and provides a common vocabulary for all kantan libraries.
It really isn’t meant to be used directly and is more of a support library for more directly useful ones.