Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types for the succinct data structure decoder
Synopsis
- type ParseFn = ByteString -> Either DecodeError Json
- type Cursor = GenericCursor ByteString CsPoppy1 (RangeMin CsPoppy1)
- type CursorHistory = CursorHistory' Count
- newtype Decoder f a = Decoder {
- runDecoder :: ParseFn -> JCurs -> DecodeResultT Count DecodeError f a
- newtype DecodeResult f a = DecodeResult {}
- newtype JCurs = JCurs {}
- mkCursor :: ByteString -> JCurs
- jsonTypeAt :: JsonTypeAt a => a -> Maybe JsonType
- data JsonType
Documentation
type ParseFn = ByteString -> Either DecodeError Json Source #
Convenience alias for the type of the function we will use to parse
the input string into the Json
structure.
type Cursor = GenericCursor ByteString CsPoppy1 (RangeMin CsPoppy1) #
type CursorHistory = CursorHistory' Count Source #
We define the index of our CursorHistory'
to be the Count
.
Decoder | |
|
Instances
Monad f => MonadError DecodeError (Decoder f) Source # | |
Defined in Waargonaut.Decode.Types throwError :: DecodeError -> Decoder f a # catchError :: Decoder f a -> (DecodeError -> Decoder f a) -> Decoder f a # | |
Monad f => Monad (Decoder f) Source # | |
Functor f => Functor (Decoder f) Source # | |
Monad f => Applicative (Decoder f) Source # | |
Monad f => Alt (Decoder f) Source # | |
MFunctor Decoder Source # | |
newtype DecodeResult f a Source #
Provide some of the type parameters that the underlying DecodeResultT
requires. This contains the state and error management as we walk around our
zipper and decode our JSON input.
Addtionally we keep our parsing function in a ReaderT
such that it's
accessible for all of the decoding steps.
Instances
Wrapper type for the SuccinctCursor
Instances
JsonTypeAt JCurs Source # | |
Defined in Waargonaut.Decode.Types | |
Wrapped JCurs Source # | |
JCurs ~ t => Rewrapped JCurs t Source # | |
Defined in Waargonaut.Decode.Types | |
type Unwrapped JCurs Source # | |
Defined in Waargonaut.Decode.Types |
mkCursor :: ByteString -> JCurs Source #
Take a ByteString
input and build an index of the JSON structure inside
jsonTypeAt :: JsonTypeAt a => a -> Maybe JsonType #