<commit_before><commit_msg>Update from Hackage at 2022-08-27T10:40:16Z<commit_after>homepage: https://sr.ht/~jack/aeson-dependent-sum
changelog-type: markdown
hash: edba301cbb649c4124e7942ab13ce542b3c56152f1ff207932d3e09981cfe85b
test-bench-deps:
  bytestring: '>=0.10 && <0.12'
  dependent-sum: -any
  constraints-extras: -any
  dependent-sum-template: ^>=0.1.1.1
  base: -any
  tasty-hedgehog: '>=1.2.0.0 && <1.4'
  hedgehog: '>=1.0.5 && <1.2'
  aeson-dependent-sum: -any
  tasty-hunit: ^>=0.10.0.2
  tasty: '>=1.2.3 && <1.5'
  aeson: -any
maintainer: <EMAIL>
synopsis: JSON encoding/decoding for dependent-sum
changelog: |
  # Revision history for aeson-dependent-sum

  ## 0.1.0.0 -- 2022-08-27

  * First version. Released on an unsuspecting world.
basic-deps:
  dependent-sum: ^>=0.7.1.0
  constraints-extras: ^>=0.3.2.1
  base: '>=4.9 && <4.18'
  some: ^>=1.0.0.3
  aeson: '>=2.0 && <2.2'
  vector: '>=0.12.3.1 && <0.14'
all-versions:
- 0.1.0.0
author: <NAME>
latest: 0.1.0.0
description-type: markdown
description: |
  # aeson-dependent-sum

  [![builds.sr.ht status](https://builds.sr.ht/~jack/aeson-dependent-sum.svg)](https://builds.sr.ht/~jack/aeson-dependent-sum?)
  [![GPLv3](https://git.sr.ht/~jack/aeson-dependent-sum/blob/master/GPLv3.png)](https://www.gnu.org/licenses/gpl-3.0.html)

  If you need to (de)serialise JSON from/to a dependent sum (from the
  [`dependent-sum`](https://hackage.haskell.org/package/dependent-sum)
  package), this library provides `newtype` wrappers which you can use
  with the
  [`-XDerivingVia`](https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/deriving_via.html#extension-DerivingVia)
  language extension. You might want to do this if:

  * You want to be work with a real value representing the sum's "tag";
    or
  * You want to take advantage of the `f` parameter provided by `DSum`.

  ## Example

  ```haskell
  data CharacterClass a where
    Fighter :: CharacterClass Fighter
    Rogue :: CharacterClass Rogue
    Wizard :: CharacterClass Wizard

  -- From the "constraints-extras" package:
  $(deriveArgDict ''CharacterClass)
  -- From the "dependent-sum-template" package. Not required, but useful:
  $(deriveGShow ''CharacterClass)
  $(deriveGEq ''CharacterClass)
  $(deriveGCompare ''CharacterClass)

  -- The derived `FromJSON`/`ToJSON` instances work on JSON objects like this:
  -- {
  --   "class": "fighter", -- or "rogue", or "wizard"
  --   "data": { ... } -- the exact fields differ depending on the value at "class".
  -- }
  newtype Character = Character (DSum CharacterClass Identity)
    deriving (FromJSON, ToJSON)
    via (TaggedObjectInline "Character" "class" CharacterClass Identity)
  ```
license-name: GPL-3.0-or-later
{'fraction_non_alphanumeric': 0.1606484893146647, 'fraction_numerical': 0.051584377302873984, 'mean_word_length': 3.6972318339100347, 'pattern_counts': {'":': 2, '<': 12, '<?xml version=': 0, '>': 17, 'https://': 7, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 10, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5546956', 'n_tokens_mistral': 1088, 'n_tokens_neox': 1014, 'n_words': 227}