Popularity
4.6
Declining
Activity
0.0
Stable
6
3
0

Monthly Downloads: 3
Programming language: Haskell
License: MIT License
Tags: Data     Web     Aeson    

aeson-applicative alternatives and similar packages

Based on the "aeson" category

Do you think we are missing an alternative of aeson-applicative or a related project?

Add another 'aeson' Package

README

make To/From JSON instances from an applicative description

data R = R { a :: Text, b :: Int32 } deriving (Typeable)

rJsonInfo :: JsonInfo R
rJsonInfo = R
        <$> "a" @: a
        <*> 'b  @: b

instance ToJSON R where
  toJSON = jiToJSON rJsonInfo
instance FromJSON R where
  parseJSON = jiParseJSON rJsonInfo

This is a simple application of a bi-directional applicative DSL concept.

It has the advantage of not requiring Template Haskell. However, the resulting code will certainly be less efficient. A faster implementation would be to use Template Haskell to generate efficient code.