Build Status codecov Latest version Join the chat at https://gitter.im/nrinaudo/kantan.codecs

kantan.codecs is a support library for the various kantan projects.

Getting started

kantan.codecs is currently available for Scala 2.11 and 2.12.

The current version is 0.5.0, 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.0"

// Provides scalaz type class instances.
libraryDependencies += "com.nrinaudo" %% "kantan.codecs-scalaz" % "0.5.0"

// Provides cats type class instances.
libraryDependencies += "com.nrinaudo" %% "kantan.codecs-cats" % "0.5.0"

Motivation

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 the same.

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.

Tutorials

The following tutorials are available: