<?xml version="1.0" encoding="UTF-8"?><feed xmlns="http://www.w3.org/2005/Atom"><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">JSON – Haskell – Aelve Guide</title><id>https://guide.aelve.com/haskell/feed/category/eajc6ai4</id><updated>2018-12-18T22:53:55Z</updated><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/feed/category/eajc6ai4"/><entry><id>veoyj6ud</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">waargonaut</title><updated>2018-12-18T22:53:55Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;a href=&#34;https://github.com/qfpl/waargonaut&#34; class=&#34;item-name&#34;&gt;waargonaut&lt;/a&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/waargonaut&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;Flexible, precise, and efficient JSON decoding/encoding library. This package provides a plethora of tools for decoding, encoding, and manipulating JSON data.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Fully RFC compliant&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Encoders and Decoders are values, they are not tied to a typeclass and as such you are not tied to a single interpretation of how a particular type &amp;quot;should&amp;quot; be handled&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;No information is discarded on parsing&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Requires slightly more code than automatically derived typeclass based approaches&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/json-eajc6ai4#item-veoyj6ud"/></entry><entry><id>q5n8qj16</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">aeson-parsec-picky</title><updated>2016-05-11T16:07:05Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;aeson-parsec-picky&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/aeson-parsec-picky&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;A JSON parser written in Parsec, can be used instead of the default Aeson parser. Intended for use with human-written JSON (config files, etc) – unlike Aeson&#39;s parser, it reports error positions, which is pretty useful.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Compatible with aeson.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Slower than the default aeson parser.&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Disallows trailing spaces, which isn&#39;t good if you simply wanted a parser that would be the same as Aeson&#39;s parser but with better error reporting.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/json-eajc6ai4#item-q5n8qj16"/></entry><entry><id>c4nwoead</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">buffer-builder</title><updated>2016-05-11T15:29:38Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;buffer-builder&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/buffer-builder&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;Another fast JSON builder.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Ecosystem&lt;/h2&gt;&lt;p&gt;&lt;a href=&#34;https://hackage.haskell.org/package/buffer-builder-aeson&#34;&gt;buffer-builder-&lt;strong&gt;aeson&lt;/strong&gt;&lt;/a&gt;&lt;/p&gt;
</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/json-eajc6ai4#item-c4nwoead"/></entry><entry><id>yfnt8pl6</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">json-incremental-decoder</title><updated>2016-05-11T15:29:29Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;json-incremental-decoder&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/json-incremental-decoder&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;Another incremental decoder.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/json-eajc6ai4#item-yfnt8pl6"/></entry><entry><id>jdr951of</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">json-encoder</title><updated>2016-05-11T15:29:19Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;json-encoder&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/json-encoder&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;A fast JSON builder.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/json-eajc6ai4#item-jdr951of"/></entry><entry><id>c89tq3y9</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">json-stream</title><updated>2016-05-11T10:37:05Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;json-stream&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/json-stream&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;A fast decoder that tries to do the least amount of work possible (e.g. it skips parsing of unnecessary fields, etc) and can even parse certain JSON structures using constant space.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Compatible with aeson.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Sometimes doesn&#39;t tell you when the JSON is malformed (this is by design, tho).&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/json-eajc6ai4#item-c89tq3y9"/></entry><entry><id>pl14ek8b</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">highjson</title><updated>2016-05-11T10:19:53Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;highjson&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/highjson&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;A fast library that tries to require less boilerplate than aeson (and provides a different parsing model). Use at your own risk.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;As fast as Aeson (&lt;a href=&#34;https://github.com/agrafix/highjson#benchmarks&#34;&gt;benchmarks&lt;/a&gt;).&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;The same declaration is used to convert to/from JSON – there&#39;s no need to write separate &lt;code&gt;ToJSON&lt;/code&gt; and &lt;code&gt;FromJSON&lt;/code&gt; instances and worry about them accidentally going out of sync.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;The library is still work in progress.&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;There are &lt;a href=&#34;https://github.com/agrafix/highjson/blob/master/test/Data/JsonSpec.hs&#34;&gt;some examples&lt;/a&gt;, but not much documentation.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/json-eajc6ai4#item-pl14ek8b"/></entry><entry><id>juzl7urk</id><title xmlns:ns="http://www.w3.org/2005/Atom" ns:type="text">aeson</title><updated>2016-04-14T09:44:48Z</updated><content xmlns:ns="http://www.w3.org/2005/Atom" ns:type="html">&lt;h1&gt;  &lt;span class=&#34;item-name&#34;&gt;aeson&lt;/span&gt;

  
  (&lt;a href=&#34;https://hackage.haskell.org/package/aeson&#34;&gt;Hackage&lt;/a&gt;)
&lt;/h1&gt;&lt;p&gt;Haskell&#39;s de-facto standard JSON parsing library.&lt;/p&gt;
&lt;h2&gt;Pros&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Widely used and actively developed.&lt;/li&gt;&lt;/p&gt;&lt;p&gt;&lt;li&gt;Fast.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Cons&lt;/h2&gt;&lt;ul&gt;&lt;p&gt;&lt;li&gt;Can be rather complicated/non-intuitive to use.&lt;/li&gt;&lt;/p&gt;&lt;/ul&gt;&lt;h2&gt;Ecosystem&lt;/h2&gt;&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Alternative instance generators:&lt;/strong&gt;
&lt;a href=&#34;https://hackage.haskell.org/package/json-autotype&#34;&gt;json-autotype&lt;/a&gt; (automatically generates types/instances from JSON files),
&lt;a href=&#34;https://hackage.haskell.org/package/generic-aeson&#34;&gt;generic-aeson&lt;/a&gt; (generates more idiomatic instances than aeson&#39;s generic derivation),&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Schemas:&lt;/strong&gt;
&lt;a href=&#34;https://hackage.haskell.org/package/json-schema&#34;&gt;json-schema&lt;/a&gt; (unrelated to &lt;a href=&#34;http://json-schema.org/&#34;&gt;json-schema.org&lt;/a&gt;),
&lt;a href=&#34;https://hackage.haskell.org/package/hjsonschema&#34;&gt;hjsonschema&lt;/a&gt; (an implementation of the &lt;a href=&#34;http://json-schema.org/&#34;&gt;json-schema.org&lt;/a&gt; standard)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Bidirectional parsing&lt;/strong&gt; (when the same declaration is used to convert to/from JSON):
&lt;a href=&#34;https://hackage.haskell.org/package/codec&#34;&gt;codec&lt;/a&gt; (there are other libraries, such as &lt;a href=&#34;https://hackage.haskell.org/package/roundtrip-aeson&#34;&gt;roundtrip-aeson&lt;/a&gt;, &lt;a href=&#34;https://hackage.haskell.org/package/JsonGrammar&#34;&gt;JsonGrammar&lt;/a&gt;, and &lt;a href=&#34;https://hackage.haskell.org/package/aeson-applicative&#34;&gt;aeson-applicative&lt;/a&gt;, but they all don&#39;t work with recent GHC)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Lens integration:&lt;/strong&gt; &lt;a href=&#34;https://hackage.haskell.org/package/lens-aeson&#34;&gt;lens-aeson&lt;/a&gt; and &lt;a href=&#34;https://hackage.haskell.org/package/microlens-aeson&#34;&gt;microlens-aeson&lt;/a&gt; (don&#39;t use &lt;a href=&#34;https://hackage.haskell.org/package/aeson-lens&#34;&gt;aeson-lens&lt;/a&gt;, it&#39;s deprecated)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Alternative parsers:&lt;/strong&gt;
&lt;a href=&#34;https://hackage.haskell.org/package/aeson-parsec-picky&#34;&gt;aeson-parsec-picky&lt;/a&gt; (an alternative parser that reports error positions; described &lt;a href=&#34;https://guide.aelve.com/haskell/json-eajc6ai4#item-q5n8qj16&#34;&gt;further&lt;/a&gt; in this category),
&lt;a href=&#34;https://hackage.haskell.org/package/json-stream&#34;&gt;json-stream&lt;/a&gt; (an incremental fast parser that can skip what it doesn&#39;t need to parse)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Utils:&lt;/strong&gt;
&lt;a href=&#34;https://hackage.haskell.org/package/aeson-casing&#34;&gt;aeson-casing&lt;/a&gt; (makes it easier to implement different casing variants like &lt;code&gt;snake_case&lt;/code&gt; or &lt;code&gt;PascalCase&lt;/code&gt; for field names),
&lt;a href=&#34;https://hackage.haskell.org/package/aeson-extra&#34;&gt;aeson-extra&lt;/a&gt; (just a grab bag of utils),
&lt;a href=&#34;https://hackage.haskell.org/package/json-extra&#34;&gt;json-extra&lt;/a&gt; (another grab bag of utils),
&lt;a href=&#34;https://hackage.haskell.org/package/aeson-prefix&#34;&gt;aeson-prefix&lt;/a&gt; (makes all keys hierarchical),
&lt;a href=&#34;https://hackage.haskell.org/package/aeson-filthy&#34;&gt;aeson-filthy&lt;/a&gt; (working with booleans encoded as “on”/“yes”/etc, case-insensitive keys, and double-encoded JSON)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Various stuff:&lt;/strong&gt;
&lt;a href=&#34;https://hackage.haskell.org/package/aeson-pretty&#34;&gt;aeson-pretty&lt;/a&gt; (pretty-prints JSON),
&lt;a href=&#34;https://hackage.haskell.org/package/aeson-qq&#34;&gt;aeson-qq&lt;/a&gt; (lets you embed JSON values in Haskell source more conveniently than you might&#39;ve done with &lt;code&gt;object&lt;/code&gt; and &lt;code&gt;.=&lt;/code&gt;),
&lt;a href=&#34;https://hackage.haskell.org/package/aeson-diff&#34;&gt;aeson-diff&lt;/a&gt; (diffs two JSON documents),
&lt;a href=&#34;https://hackage.haskell.org/package/aeson-better-errors&#34;&gt;aeson-better-errors&lt;/a&gt; (gives better conversion errors)&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Instances, etc:&lt;/strong&gt;
&lt;a href=&#34;https://hackage.haskell.org/package/pipes-aeson&#34;&gt;pipes-aeson&lt;/a&gt;,
&lt;a href=&#34;https://hackage.haskell.org/package/binary-orphans&#34;&gt;binary-orphans&lt;/a&gt; (instances for &lt;code&gt;Binary&lt;/code&gt;)&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;Notes&lt;/h2&gt;&lt;h1&gt;&lt;span id=&#34;item-notes-juzl7urk-links&#34;&gt;&lt;/span&gt;Links&lt;/h1&gt;&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://artyom.me/aeson&#34;&gt;a long tutorial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://hackage.haskell.org/package/aeson/docs/Data-Aeson.html#g:1&#34;&gt;examples in docs&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</content><link xmlns:ns="http://www.w3.org/2005/Atom" ns:href="https://guide.aelve.com/haskell/json-eajc6ai4#item-juzl7urk"/></entry></feed>