Safe Haskell | None |
---|
This module provides a few small functions to make working with aeson easier. Hopefully at some point they won't be needed anymore.
- module Data.Aeson
- module Data.Aeson.Types
- decodeV :: FromJSON a => ByteString -> Maybe a
- eitherDecodeV :: FromJSON a => ByteString -> Either String a
- fromFloatDigits :: RealFloat a => a -> Scientific
- (.=?) :: ToJSON a => Text -> Maybe a -> Maybe Pair
- parseNumber :: Scientific -> Either Integer Double
Documentation
module Data.Aeson
module Data.Aeson.Types
Parsing values
decodeV :: FromJSON a => ByteString -> Maybe aSource
Deserialize any JSON value. Allows atomic values on the top level
eitherDecodeV :: FromJSON a => ByteString -> Either String aSource
Like decodeV
, but returns an error message when decoding fails.
Utilities
fromFloatDigits :: RealFloat a => a -> Scientific
Efficient and exact conversion from a RealFloat
into a
Scientific
number.
parseNumber :: Scientific -> Either Integer DoubleSource
Convert a Scientific into an Integer if it doesn't have decimal points, otherwise to a Double.