| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
MatrixBot.AesonUtils
Synopsis
- myGenericToJSON :: (Generic a, Typeable a, GToJSON' Value Zero (Rep a)) => a -> Value
- myGenericParseJSON :: (Generic a, Typeable a, GFromJSON Zero (Rep a)) => Value -> Parser a
- cutTypeNamePrefix :: Typeable a => Proxy a -> Options -> Options
- camelCaseToSnakeCase :: Options -> Options
Documentation
myGenericToJSON :: (Generic a, Typeable a, GToJSON' Value Zero (Rep a)) => a -> Value Source #
myGenericParseJSON :: (Generic a, Typeable a, GFromJSON Zero (Rep a)) => Value -> Parser a Source #
cutTypeNamePrefix :: Typeable a => Proxy a -> Options -> Options Source #
Cut type name prefix from each field
For instance if type is called “Foo” and its fields are “fooBar” and “fooBaz” then its fields will be named “bar” and “baz”. If prefix doesn’t equal to “foo” (to the type name) then the field name stays unchanged.
camelCaseToSnakeCase :: Options -> Options Source #
Convert “camelCase” to “snake_case” for each field