Safe Haskell | None |
---|---|
Language | Haskell2010 |
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.
AesonRecord | |
|
Instances
(HasJSONOptions (AesonRecord a), Generic a, GToJSON Zero (Rep a), GToEncoding Zero (Rep a)) => ToJSON (AesonRecord a) Source # | |
Defined in AesonVia toJSON :: AesonRecord a -> Value # toEncoding :: AesonRecord a -> Encoding # toJSONList :: [AesonRecord a] -> Value # toEncodingList :: [AesonRecord a] -> Encoding # | |
(HasJSONOptions (AesonRecord a), Generic a, GFromJSON Zero (Rep a)) => FromJSON (AesonRecord a) Source # | |
Defined in AesonVia parseJSON :: Value -> Parser (AesonRecord a) # parseJSONList :: Value -> Parser [AesonRecord a] # | |
HasJSONOptions (AesonRecord a) Source # | |
Defined in AesonVia 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.
Instances
(Newtype n, o ~ O n, ToJSON o) => ToJSON (AesonNewtype n o) Source # | |
Defined in AesonVia toJSON :: AesonNewtype n o -> Value # toEncoding :: AesonNewtype n o -> Encoding # toJSONList :: [AesonNewtype n o] -> Value # toEncodingList :: [AesonNewtype n o] -> Encoding # | |
(Newtype n, o ~ O n, FromJSON o) => FromJSON (AesonNewtype n o) Source # | |
Defined in AesonVia parseJSON :: Value -> Parser (AesonNewtype n o) # parseJSONList :: Value -> Parser [AesonNewtype n o] # | |
HasJSONOptions (AesonNewtype n o) Source # | |
Defined in AesonVia getJSONOptions :: Proxy (AesonNewtype n o) -> Options Source # |
Generic deriving ToJSON/FromJSON via this uses HasTagPrefix
to turn Bounded
Enum
datatypes into enumerated strings.
AesonTag | |
|
class HasJSONOptions a where Source #
Mostly an internal class directing constructor/field conversion.
getJSONOptions :: Proxy a -> Options Source #
Instances
HasJSONOptions (AesonRecord a) Source # | |
Defined in AesonVia getJSONOptions :: Proxy (AesonRecord a) -> Options Source # | |
HasTagPrefix a => HasJSONOptions (AesonTag a) Source # | |
HasJSONOptions (AesonNewtype n o) Source # | |
Defined in AesonVia getJSONOptions :: Proxy (AesonNewtype n o) -> Options Source # |