cabal-version: 1.12 -- This file has been generated from package.yaml by hpack version 0.33.0. -- -- see: https://github.com/sol/hpack -- -- hash: 50882ba4b5afe99b10c863f3ca7ba3aa9a791a89c6bc92313ad570c45122a88a name: json-alt version: 1.0.0 synopsis: Union 'alternative' or Either that has untagged JSON encoding. description: Parsing JSON with Aeson often requires decoding fields that have more than one Haskell type. . So we have: . > data a :|: b = AltLeft a > | AltRight 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 homepage: https://github.com/mgajda/json-autotype.git#readme license: BSD3 license-file: LICENSE stability: stable author: Michal J. Gajda maintainer: simons@cryp.to, mjgajda@gmail.com copyright: Copyright by Migamake '2014-'2018 category: Data, Tools build-type: Simple extra-source-files: README.md changelog.md bug-reports: https://github.com/mgajda/json-autotype.git/issues source-repository head type: git location: https://github.com/mgajda/json-autotype.git library exposed-modules: Data.Aeson.AutoType.Alternative other-modules: Paths_json_alt other-extensions: TemplateHaskell ScopedTypeVariables OverloadedStrings FlexibleInstances MultiParamTypeClasses DeriveDataTypeable DeriveGeneric RecordWildCards build-depends: aeson >=1.2.1 && <1.5 , base >=4.3 && <5 default-language: Haskell2010