json-alt (hackage): 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
Keywords: bsd3|data|library|tools|elm|hackage|hacktoberfest2019|haskell|inference|json|json-autotype|parse|parser|unification|union