json-alt
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
Ecosystem
hackage.haskell.org
hackage.haskell.org
Latest Release
over 7 years ago
1.0.0
over 7 years ago
Versions
1
1
Downloads
1,259 total
1,259 total
Dependent Repos
3
3
Loading...
Readme
Loading...
Links
| Registry | hackage.haskell.org |
| Source | Repository |
| JSON API | View JSON |
| CodeMeta | codemeta.json |
Package Details
| PURL |
pkg:hackage/json-alt
spec |
| License | BSD-3-Clause |
| First Release | over 7 years ago |
| Last Synced | 17 days ago |
Repository
| Stars | 149 on GitHub |
| Forks | 23 on GitHub |
| Commits | 566 |
| Committers | 10 |
| Avg per Author | 56.6 |
| DDS | 0.546 |
Rankings on hackage.haskell.org
Forks
Top 7.7%