Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: d1ad6402f3

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 config
Octocat-spinner-32 etc
Octocat-spinner-32 example
Octocat-spinner-32 project
Octocat-spinner-32 src
Octocat-spinner-32 .gitignore
Octocat-spinner-32 README.md
Octocat-spinner-32 sbt
README.md

Argonaut

What is Argonaut?

Argonaut is a JSON library built using Scala. It provides functionality to specify how to convert to and from JSON for an arbitrary Scala object. It relies on the Scala parser libraries (util.parsing.combinator) to read an arbitrary string into a JSON data type, which is known to be slow. Argonaut is licenced under BSD3 (see etc/LICENCE).

The JSON data type also implements a large combinator library in an effort to make it easy to use, however, much of this library would be better implemented by exploiting partial lenses and a zipper.

Argonaut is intended for simple applications that use specification-compliant JSON. Argonaut is released under a BSD3 open-source licence.

Features

  • Lenses and partial lenses for product and sum types, in particular for viewing and updating values of the Json sum type.
  • A zipper (com.ephox.argonaut.Cursor) for traversing and updating a Json data structure.
  • A traversal data structure (com.ephox.argonaut.Shift) that tracks its history of visited positions with an underlying cursor.
  • A pretty-printer for outputting JSON values.
  • A codec for taking values of arbitrary type to and from JSON values.

SBT Settings

To use argonaut, add the following repositories to your build:

override lazy val settings =
  super.settings ++
    Seq(resolvers := Seq(
      "mth.io snapshots"  at "http://repo.mth.io/snapshots"
    , "mth.io releases"  at "http://repo.mth.io/releases"
    , "snapshots" at "http://oss.sonatype.org/content/repositories/snapshots"
    , "releases"  at "http://oss.sonatype.org/content/repositories/releases"
    ))

Note that we are currently using a head version of scalaz-seven until it gets released. But it should be fine to use scalaz-seven M2 if required.

Then add argonaut as a dependency:

"com.ephox" %% "argonaut" % "4.0" withSources

Future Improvements

  • Use a more appropriate parser library (not Scala parsers) to improve performance and usability.

Copyright 2012 Ephox Pty Ltd

Something went wrong with that request. Please try again.