Safe Haskell | None |
---|---|
Language | Haskell2010 |
Extensions |
|
Synopsis
- data Decoder a
- data HermesEnv = HermesEnv {
- hParser :: !(ForeignPtr SIMDParser)
- hDocument :: !(ForeignPtr SIMDDocument)
- hPath :: !Text
- data HermesException
- data DocumentError
- allocaValue :: (Value -> Decoder a) -> Decoder a
- allocaArray :: (Array -> Decoder a) -> Decoder a
- allocaArrayIter :: (ArrayIter -> Decoder a) -> Decoder a
- allocaObject :: (Object -> Decoder a) -> Decoder a
- allocaObjectIter :: (ObjectIter -> Decoder a) -> Decoder a
- handleErrorCode :: Text -> CInt -> Decoder ()
- typePrefix :: Text -> Text
- withDocumentPointer :: (Document -> Decoder a) -> Decoder a
- withParserPointer :: (Parser -> Decoder a) -> Decoder a
- withHermesEnv :: MonadUnliftIO m => (HermesEnv -> m a) -> m a
Documentation
A Decoder is some context around the IO needed by the C FFI to allocate local memory.
Users shouldn't need to deal with the underlying IO except in advanced use cases.
Using decodeEither
discharges the IO and returns us to purity,
since we know decoding a document is referentially transparent.
Instances
Monad Decoder Source # | |
Functor Decoder Source # | |
MonadFail Decoder Source # | |
Defined in Data.Hermes.Decoder.Types | |
Applicative Decoder Source # | |
Alternative Decoder Source # | |
MonadIO Decoder Source # | |
Defined in Data.Hermes.Decoder.Types | |
MonadUnliftIO Decoder Source # | |
Defined in Data.Hermes.Decoder.Types | |
MonadReader HermesEnv Decoder Source # | |
Contains foreign references to the allocated simdjson::parser and simdjson::document. Also maintains a path string that is updated when an object field or array value is entered and which is displayed in errors.
HermesEnv | |
|
data HermesException Source #
The library can throw exceptions from simdjson in addition to its own exceptions.
SIMDException DocumentError | An exception thrown from the simdjson library. |
InternalException DocumentError | An exception thrown from an internal library function. |
Instances
data DocumentError Source #
Record containing all pertinent information for troubleshooting an exception.
Instances
allocaObjectIter :: (ObjectIter -> Decoder a) -> Decoder a Source #
typePrefix :: Text -> Text Source #
withHermesEnv :: MonadUnliftIO m => (HermesEnv -> m a) -> m a Source #