Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
AesonVia
Description
Synopsis
- newtype AesonRecord a = AesonRecord {
- unAesonRecord :: a
- newtype AesonNewtype n o = AesonNewtype {
- unAesonNewtype :: n
- newtype AesonTag a = AesonTag {
- unAesonTag :: a
- class HasJSONOptions a where
- getJSONOptions :: Proxy a -> Options
- class HasTagPrefix a where
- getTagPrefix :: Proxy a -> Text
Documentation
newtype AesonRecord a Source #
Generic deriving ToJSON/FromJSON via this removes the common field name prefix in the encoding.
Constructors
AesonRecord | |
Fields
|
Instances
(HasJSONOptions (AesonRecord a), Generic a, GFromJSON Zero (Rep a)) => FromJSON (AesonRecord a) Source # | |
Defined in AesonVia Methods parseJSON :: Value -> Parser (AesonRecord a) # parseJSONList :: Value -> Parser [AesonRecord a] # omittedField :: Maybe (AesonRecord a) # | |
(HasJSONOptions (AesonRecord a), Generic a, GToJSON Zero (Rep a), GToEncoding Zero (Rep a)) => ToJSON (AesonRecord a) Source # | |
Defined in AesonVia Methods toJSON :: AesonRecord a -> Value # toEncoding :: AesonRecord a -> Encoding # toJSONList :: [AesonRecord a] -> Value # toEncodingList :: [AesonRecord a] -> Encoding # omitField :: AesonRecord a -> Bool # | |
HasJSONOptions (AesonRecord a) Source # | |
Defined in AesonVia Methods getJSONOptions :: Proxy (AesonRecord a) -> Options Source # |
newtype AesonNewtype n o Source #
Generic deriving ToJSON/FromJSON via this yields an encoding equivalent to the wrapped type.
Constructors
AesonNewtype | |
Fields
|
Instances
(Newtype n, o ~ O n, FromJSON o) => FromJSON (AesonNewtype n o) Source # | |
Defined in AesonVia Methods parseJSON :: Value -> Parser (AesonNewtype n o) # parseJSONList :: Value -> Parser [AesonNewtype n o] # omittedField :: Maybe (AesonNewtype n o) # | |
(Newtype n, o ~ O n, ToJSON o) => ToJSON (AesonNewtype n o) Source # | |
Defined in AesonVia Methods toJSON :: AesonNewtype n o -> Value # toEncoding :: AesonNewtype n o -> Encoding # toJSONList :: [AesonNewtype n o] -> Value # toEncodingList :: [AesonNewtype n o] -> Encoding # omitField :: AesonNewtype n o -> Bool # | |
HasJSONOptions (AesonNewtype n o) Source # | |
Defined in AesonVia Methods getJSONOptions :: Proxy (AesonNewtype n o) -> Options Source # |
Generic deriving ToJSON/FromJSON via this uses HasTagPrefix
to turn Bounded
Enum
datatypes into enumerated strings.
Constructors
AesonTag | |
Fields
|
class HasJSONOptions a where Source #
Mostly an internal class directing constructor/field conversion.
Methods
getJSONOptions :: Proxy a -> Options Source #
Instances
HasJSONOptions (AesonRecord a) Source # | |
Defined in AesonVia Methods getJSONOptions :: Proxy (AesonRecord a) -> Options Source # | |
HasTagPrefix a => HasJSONOptions (AesonTag a) Source # | |
HasJSONOptions (AesonNewtype n o) Source # | |
Defined in AesonVia Methods getJSONOptions :: Proxy (AesonNewtype n o) -> Options Source # |