json-alt
Union 'alternative' or Either that has untagged JSON encoding.
Parsing JSON with Aeson often requires decoding fields
that have more than one Haskell type.
So we have:
```
data a :|: b = AltLeft a
| AltLeft b
printIt = print . (fromJSON :: ByteString -> Int :|: Bool)
main = do
printIt "1" -- AltLeft 1
printIt "true" -- AltRight True
printIt "null" -- errors!
```
To generate types for larger JSON documents,
you might use `json-autotype`.
This is separate package so that users
do not have to keep `json-autotype` as runtime
dependency.
See <https://github.com/mgajda/json-autotype>
| version | uploaded | uploader | changes | |
|---|---|---|---|---|
| 1.0.0 | 2018-11-28 13:45 UTC | MichalGajda | +168/−0 lines, 6 filesdep +aesondep +basesetup-changed |
Dependencies of json-alt-1.0.0
aeson >=1.2.1 && <1.5 1.4.7.1 → 2.3.3.0 newer than bounds
| 2026-11-23 21:23 UTC | 2.3.3.0 newer than bounds | +124/−38 lines, 10 filesPVP ok |
| 2026-09-12 18:04 UTC | 2.3.2.0 newer than bounds | +97/−60 lines, 13 filesPVP ok |
| 2026-07-05 10:37 UTC | 2.3.1.0 newer than bounds | +101/−42 lines, 17 filesdep ~text-iso8601PVP ok |
| 2026-05-21 08:35 UTC | 2.3.0.0 newer than bounds | +54/−41 lines, 17 filesdep ~nothunksdep ~text-iso8601new-uploaderPVP ok |
| 2026-08-29 13:20 UTC | 2.2.5.1 newer than bounds | +36/−24 lines, 4 filesnew-uploaderPVP ok |
showing 5 of 106 versions
base >=4.3 && <5 4.22.0.0 → 4.22.1.0
| 2026-12-01 12:38 UTC | 4.22.1.0 | +388/−6 lines, 9 filesdep ~ghc-internalPVP: major bump suggested |
| 2025-12-19 11:52 UTC | 4.22.0.0 | +886/−215 lines, 28 filesdep ~ghc-internalPVP ok |
| 2026-03-27 12:26 UTC | 4.21.2.0 | +10/−3 lines, 4 filesdep ~ghc-internalPVP ok |
| 2025-12-27 10:31 UTC | 4.21.1.0 | +17/−5 lines, 4 filesdep ~ghc-internalPVP ok |
| 2024-12-16 09:24 UTC | 4.21.0.0 | +1170/−396 lines, 39 filesdep ~ghc-internalPVP ok |
showing 5 of 61 versions
Reverse dependencies
4 packages depend on json-alt