| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Data.EJson.EJson
Description
Currently EJson functionality is built on top of the
Value type.
Functions are written to convert back and forth between
EJsonValue and Value.
The conversion functions from EJsonValue to Value are in a seperate module: Data.EJson.EJson2Value.
This has some negative impact on performance, but aids simplicity.
- data EJsonValue
- = EJObject !(HashMap Text EJsonValue)
- | EJArray !(Vector EJsonValue)
- | EJString !Text
- | EJNumber !Scientific
- | EJBool !Bool
- | EJDate !UTCTime
- | EJBinary !ByteString
- | EJUser !Text !EJsonValue
- | EJNull
- value2EJson :: Value -> EJsonValue
- ejobject :: [(Text, EJsonValue)] -> EJsonValue
- ejarray :: [EJsonValue] -> EJsonValue
- ejstring :: Text -> EJsonValue
- ejnumber :: Scientific -> EJsonValue
- ejbool :: Bool -> EJsonValue
- ejdate :: Scientific -> EJsonValue
- ejbinary :: ByteString -> EJsonValue
- ejuser :: Text -> EJsonValue -> EJsonValue
- ejnull :: EJsonValue
- _EJObject :: Prism' EJsonValue (HashMap Text EJsonValue)
- _EJObjectKey :: Text -> Traversal' EJsonValue (Maybe EJsonValue)
- _EJObjectKeyString :: Applicative f => Text -> (Text -> f Text) -> EJsonValue -> f EJsonValue
- _EJArray :: Prism' EJsonValue (Vector EJsonValue)
- _EJAraryIndex :: Applicative f => Int -> (EJsonValue -> f EJsonValue) -> EJsonValue -> f EJsonValue
- _EJString :: Prism' EJsonValue Text
- _EJNumber :: Prism' EJsonValue Scientific
- _EJBool :: Prism' EJsonValue Bool
- _EJDate :: Prism' EJsonValue UTCTime
- _EJBinary :: Prism' EJsonValue ByteString
- _EJUser :: Prism' EJsonValue (Text, EJsonValue)
- _EJNull :: Prism' EJsonValue ()
Documentation
data EJsonValue Source
Constructors
| EJObject !(HashMap Text EJsonValue) | |
| EJArray !(Vector EJsonValue) | |
| EJString !Text | |
| EJNumber !Scientific | |
| EJBool !Bool | |
| EJDate !UTCTime | |
| EJBinary !ByteString | |
| EJUser !Text !EJsonValue | |
| EJNull |
Instances
| Eq EJsonValue | |
| Num EJsonValue | |
| Show EJsonValue | |
| IsString EJsonValue | |
| ToJSON EJsonValue | A ToJSON instance is provided for EJsonValue in order to be able to take advantage of the Aeson functionality. This is not used internally. |
| FromJSON EJsonValue | A FromJSON instance is provided for EJsonValue in order to be able to take advantage of the Aeson functionality. This is not used internally. |
| Monoid EJsonValue |
value2EJson :: Value -> EJsonValue Source
ejobject :: [(Text, EJsonValue)] -> EJsonValue Source
ejarray :: [EJsonValue] -> EJsonValue Source
ejstring :: Text -> EJsonValue Source
ejnumber :: Scientific -> EJsonValue Source
ejbool :: Bool -> EJsonValue Source
ejdate :: Scientific -> EJsonValue Source
ejbinary :: ByteString -> EJsonValue Source
ejuser :: Text -> EJsonValue -> EJsonValue Source
_EJObjectKeyString :: Applicative f => Text -> (Text -> f Text) -> EJsonValue -> f EJsonValue Source
A helpful prism that looks up values of type EJ{"foo" : "bar", ...} with a Text key "foo" and returns Just "bar", or Nothing. Used frequently for checking message types and ids.
_EJAraryIndex :: Applicative f => Int -> (EJsonValue -> f EJsonValue) -> EJsonValue -> f EJsonValue Source
_EJUser :: Prism' EJsonValue (Text, EJsonValue) Source
_EJNull :: Prism' EJsonValue () Source