Safe Haskell | None |
---|---|
Language | Haskell2010 |
Top level types and functions for Waargonaut Json
types.
Synopsis
- data JType ws a
- class AsJType r ws a | r -> ws a where
- newtype Json = Json (JType WS Json)
- waargonautBuilder :: (WS -> Builder) -> Json -> Builder
- parseWaargonaut :: (Monad f, CharParsing f) => f Json
- jsonTraversal :: Traversal' Json Json
- jsonWSTraversal :: Traversal Json Json WS WS
- jtypeTraversal :: Traversal (JType ws a) (JType ws a') a a'
- jtypeWSTraversal :: Traversal (JType ws a) (JType ws' a) ws ws'
Inner JSON types
Individual JSON Types and their trailing whitespace.
Instances
Bitraversable JType Source # | |
Defined in Waargonaut.Types.Json bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> JType a b -> f (JType c d) # | |
Bifoldable JType Source # | |
Bifunctor JType Source # | |
Functor (JType ws) Source # | |
Foldable (JType ws) Source # | |
Defined in Waargonaut.Types.Json fold :: Monoid m => JType ws m -> m # foldMap :: Monoid m => (a -> m) -> JType ws a -> m # foldr :: (a -> b -> b) -> b -> JType ws a -> b # foldr' :: (a -> b -> b) -> b -> JType ws a -> b # foldl :: (b -> a -> b) -> b -> JType ws a -> b # foldl' :: (b -> a -> b) -> b -> JType ws a -> b # foldr1 :: (a -> a -> a) -> JType ws a -> a # foldl1 :: (a -> a -> a) -> JType ws a -> a # elem :: Eq a => a -> JType ws a -> Bool # maximum :: Ord a => JType ws a -> a # minimum :: Ord a => JType ws a -> a # | |
Traversable (JType ws) Source # | |
(Eq ws, Eq a) => Eq (JType ws a) Source # | |
(Show ws, Show a) => Show (JType ws a) Source # | |
AsJType (JType ws a) ws a Source # | |
Defined in Waargonaut.Types.Json |
class AsJType r ws a | r -> ws a where Source #
Typeclass for things that can represent a JType
_JType :: Prism' r (JType ws a) Source #
_JNull :: Prism' r ws Source #
_JBool :: Prism' r (Bool, ws) Source #
_JNum :: Prism' r (JNumber, ws) Source #
_JStr :: Prism' r (JString, ws) Source #
Instances
AsJType Json WS Json Source # | |
AsJType (JType ws a) ws a Source # | |
Defined in Waargonaut.Types.Json |
Top level JSON type
Top level Json type, we specialise the whitespace to WS
and the digit
type to Digit
. Also defining that our structures can recursively only contain
Json
types.
Instances
Eq Json Source # | |
Show Json Source # | |
Wrapped Json Source # | |
Json ~ t => Rewrapped Json t Source # | |
Defined in Waargonaut.Types.Json | |
AsJType Json WS Json Source # | |
Monad f => MonadReader ParseFn (DecodeResult f) Source # | |
Defined in Waargonaut.Decode.Types ask :: DecodeResult f ParseFn # local :: (ParseFn -> ParseFn) -> DecodeResult f a -> DecodeResult f a # reader :: (ParseFn -> a) -> DecodeResult f a # | |
type Unwrapped Json Source # | |
Parser / Builder
waargonautBuilder :: (WS -> Builder) -> Json -> Builder Source #
Using the given whitespace builder, create a builder for a given Json
value.
parseWaargonaut :: (Monad f, CharParsing f) => f Json Source #
Parse to a Json
value, keeping all of the information about the leading
and trailing whitespace.
Traversals
jsonTraversal :: Traversal' Json Json Source #
Ignoring whitespace, traverse a Json
structure.
jsonWSTraversal :: Traversal Json Json WS WS Source #
Traverse the trailing whitespace of this Json
structure.