MyNixOS website logo
Description

High-performance JSON parser and encoder.

This library parses JSON into a Value type that is consistent with the ABNF described in RFC 7159. The parser is about six times faster than the parser that aeson provides. This parser is however, non-resumable, so if resumable parsing is important, aeson should be preferred.

This library does not include any functions or typeclasses to help users marshal Value to their application-specific data types. Such functions and typeclasses are outside the scope of this library. If anyone writes a library that offers users these conveniences open a issue so that the json-syntax documentation can point users to it.

json-syntax

This library parses JSON into a Value type that is consistent with the ABNF described in RFC 7159. The parser is about six times faster than the parser that aeson provides. This parser is however, non-resumable, so if resumable parsing is important, aeson should be preferred. Results from the benchmark suite:

benchmarked json/twitter/100
time                 208.6 μs   (207.1 μs .. 210.1 μs)
                     1.000 R²   (0.999 R² .. 1.000 R²)
mean                 211.8 μs   (210.7 μs .. 213.3 μs)
std dev              4.493 μs   (3.299 μs .. 7.422 μs)

benchmarked aeson/twitter/100
time                 1.284 ms   (1.267 ms .. 1.296 ms)
                     0.999 R²   (0.999 R² .. 1.000 R²)
mean                 1.282 ms   (1.276 ms .. 1.292 ms)
std dev              26.07 μs   (17.87 μs .. 40.01 μs)

This library does not include any functions or typeclasses to help users convert data from Value, the RFC-7159-inspired syntax tree data type. Such functions and typeclasses are outside the scope of this library. If anyone writes a library that helps users marshal their data in this way, open a issue so that the json-syntax documentation can point users to it.

Metadata

Version

0.2.7.2

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows