waargonaut-0.8.0.1: JSON wrangling

Safe HaskellNone
LanguageHaskell2010

Waargonaut.Types.JObject.JAssoc

Contents

Description

Types and functions for handling our representation of a key:value pair in a JSON object.

Synopsis

Key/value pair type

data JAssoc ws a Source #

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.

Instances
Bifunctor JAssoc Source # 
Instance details

Defined in Waargonaut.Types.JObject.JAssoc

Methods

bimap :: (a -> b) -> (c -> d) -> JAssoc a c -> JAssoc b d #

first :: (a -> b) -> JAssoc a c -> JAssoc b c #

second :: (b -> c) -> JAssoc a b -> JAssoc a c #

Bitraversable JAssoc Source # 
Instance details

Defined in Waargonaut.Types.JObject.JAssoc

Methods

bitraverse :: Applicative f => (a -> f c) -> (b -> f d) -> JAssoc a b -> f (JAssoc c d) #

Bifoldable JAssoc Source # 
Instance details

Defined in Waargonaut.Types.JObject.JAssoc

Methods

bifold :: Monoid m => JAssoc m m -> m #

bifoldMap :: Monoid m => (a -> m) -> (b -> m) -> JAssoc a b -> m #

bifoldr :: (a -> c -> c) -> (b -> c -> c) -> c -> JAssoc a b -> c #

bifoldl :: (c -> a -> c) -> (c -> b -> c) -> c -> JAssoc a b -> c #

Functor (JAssoc ws) Source # 
Instance details

Defined in Waargonaut.Types.JObject.JAssoc

Methods

fmap :: (a -> b) -> JAssoc ws a -> JAssoc ws b #

(<$) :: a -> JAssoc ws b -> JAssoc ws a #

Foldable (JAssoc ws) Source # 
Instance details

Defined in Waargonaut.Types.JObject.JAssoc

Methods

fold :: Monoid m => JAssoc ws m -> 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] #

null :: JAssoc ws a -> Bool #

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 #

sum :: Num a => JAssoc ws a -> a #

product :: Num a => JAssoc ws a -> a #

Traversable (JAssoc ws) Source # 
Instance details

Defined in Waargonaut.Types.JObject.JAssoc

Methods

traverse :: Applicative f => (a -> f b) -> JAssoc ws a -> f (JAssoc ws b) #

sequenceA :: Applicative f => JAssoc ws (f a) -> f (JAssoc ws a) #

mapM :: Monad m => (a -> m b) -> JAssoc ws a -> m (JAssoc ws b) #

sequence :: Monad m => JAssoc ws (m a) -> m (JAssoc ws a) #

(Eq ws, Eq a) => Eq (JAssoc ws a) Source # 
Instance details

Defined in Waargonaut.Types.JObject.JAssoc

Methods

(==) :: JAssoc ws a -> JAssoc ws a -> Bool #

(/=) :: JAssoc ws a -> JAssoc ws a -> Bool #

(Show ws, Show a) => Show (JAssoc ws a) Source # 
Instance details

Defined in Waargonaut.Types.JObject.JAssoc

Methods

showsPrec :: Int -> JAssoc ws a -> ShowS #

show :: JAssoc ws a -> String #

showList :: [JAssoc ws a] -> ShowS #

HasJAssoc (JAssoc ws a) ws a Source # 
Instance details

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.

Minimal complete definition

jAssoc

Parse

parseJAssoc :: (Monad f, CharParsing f) => f ws -> f a -> f (JAssoc ws a) Source #

Parse a single "key:value" pair

Update

jAssocAlterF :: (Monoid ws, Functor f) => Text -> (Maybe a -> f (Maybe a)) -> Maybe (JAssoc ws a) -> f (Maybe (JAssoc ws a)) Source #

Helper function for trying to update/create a JAssoc value in some Functor. This function is analogus to the alterF function.