Safe Haskell | None |
---|---|
Language | Haskell2010 |
Types and functions for handling our representation of a key:value pair in a JSON object.
Synopsis
- data JAssoc ws a = JAssoc {
- _jsonAssocKey :: JString
- _jsonAssocKeyTrailingWS :: ws
- _jsonAssocValPreceedingWS :: ws
- _jsonAssocVal :: a
- class HasJAssoc c ws a | c -> ws a where
- jAssoc :: Lens' c (JAssoc ws a)
- jsonAssocKey :: Lens' c JString
- jsonAssocKeyTrailingWS :: Lens' c ws
- jsonAssocVal :: Lens' c a
- jsonAssocValPreceedingWS :: Lens' c ws
- parseJAssoc :: (Monad f, CharParsing f) => f ws -> f a -> f (JAssoc ws a)
- jAssocAlterF :: (Monoid ws, Functor f) => Text -> (Maybe a -> f (Maybe a)) -> Maybe (JAssoc ws a) -> f (Maybe (JAssoc ws a))
Key/value pair type
This type represents the key:value pair inside of a JSON object.
It is built like this so that we can preserve any whitespace information that may surround it.
JAssoc | |
|
Instances
Bitraversable JAssoc Source # | |
Defined in Waargonaut.Types.JObject.JAssoc bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> JAssoc a b -> f (JAssoc c d) # | |
Bifoldable JAssoc Source # | |
Bifunctor JAssoc Source # | |
Functor (JAssoc ws) Source # | |
Foldable (JAssoc ws) Source # | |
Defined in Waargonaut.Types.JObject.JAssoc fold :: Monoid m => JAssoc ws m -> m # foldMap :: Monoid m => (a -> m) -> JAssoc ws a -> m # foldMap' :: Monoid m => (a -> m) -> JAssoc ws a -> m # foldr :: (a -> b -> b) -> b -> JAssoc ws a -> b # foldr' :: (a -> b -> b) -> b -> JAssoc ws a -> b # foldl :: (b -> a -> b) -> b -> JAssoc ws a -> b # foldl' :: (b -> a -> b) -> b -> JAssoc ws a -> b # foldr1 :: (a -> a -> a) -> JAssoc ws a -> a # foldl1 :: (a -> a -> a) -> JAssoc ws a -> a # toList :: JAssoc ws a -> [a] # length :: JAssoc ws a -> Int # elem :: Eq a => a -> JAssoc ws a -> Bool # maximum :: Ord a => JAssoc ws a -> a # minimum :: Ord a => JAssoc ws a -> a # | |
Traversable (JAssoc ws) Source # | |
Defined in Waargonaut.Types.JObject.JAssoc | |
(Eq ws, Eq a) => Eq (JAssoc ws a) Source # | |
(Show ws, Show a) => Show (JAssoc ws a) Source # | |
HasJAssoc (JAssoc ws a) ws a Source # | |
Defined in Waargonaut.Types.JObject.JAssoc |
class HasJAssoc c ws a | c -> ws a where Source #
This class allows you to write connective lenses for other data structures
that may contain a JAssoc
.
jAssoc :: Lens' c (JAssoc ws a) Source #
jsonAssocKey :: Lens' c JString Source #
jsonAssocKeyTrailingWS :: Lens' c ws Source #
jsonAssocVal :: Lens' c a Source #
jsonAssocValPreceedingWS :: Lens' c ws Source #
Instances
HasJAssoc (JAssoc ws a) ws a Source # | |
Defined in Waargonaut.Types.JObject.JAssoc |
Parse
parseJAssoc :: (Monad f, CharParsing f) => f ws -> f a -> f (JAssoc ws a) Source #
Parse a single "key:value" pair