keter-1.8.4: Web application deployment manager, focusing on Haskell web frameworks
Safe HaskellNone
LanguageHaskell98

Data.Aeson.KeyHelper

Description

Utilities for dealing with Aeson version update

Synopsis

Documentation

fromMapText :: Map Text v -> KeyMap v #

Convert a Map Textto a KeyMap.

Since: aeson-2.0.2.0

toMapText :: KeyMap v -> Map Text v #

Convert a KeyMap to a Map Text.

Since: aeson-2.0.2.0

toHashMapText :: KeyMap v -> HashMap Text v #

Convert a KeyMap to a HashMap Text.

alignWithKey :: (Key -> These a b -> c) -> KeyMap a -> KeyMap b -> KeyMap c #

Generalized union with combining function.

alignWith :: (These a b -> c) -> KeyMap a -> KeyMap b -> KeyMap c #

Generalized union with combining function.

mapMaybeWithKey :: (Key -> v -> Maybe u) -> KeyMap v -> KeyMap u #

Map values and collect the Just results.

mapMaybe :: (a -> Maybe b) -> KeyMap a -> KeyMap b #

Map values and collect the Just results.

filterWithKey :: (Key -> v -> Bool) -> KeyMap v -> KeyMap v #

Filter all keys/values that satisfy some predicate.

filter :: (v -> Bool) -> KeyMap v -> KeyMap v #

Filter all keys/values that satisfy some predicate.

mapKeyVal :: (Key -> Key) -> (v1 -> v2) -> KeyMap v1 -> KeyMap v2 #

Transform the keys and values of a KeyMap.

fromMap :: Map Key v -> KeyMap v #

Convert a Map to a KeyMap.

toMap :: KeyMap v -> Map Key v #

Convert a KeyMap to a Map.

fromHashMap :: HashMap Key v -> KeyMap v #

Convert a HashMap to a KeyMap.

toHashMap :: KeyMap v -> HashMap Key v #

Convert a KeyMap to a HashMap.

keys :: KeyMap v -> [Key] #

Return a list of this map's keys.

intersectionWithKey :: (Key -> a -> b -> c) -> KeyMap a -> KeyMap b -> KeyMap c #

The intersection with a combining function.

intersectionWith :: (a -> b -> c) -> KeyMap a -> KeyMap b -> KeyMap c #

The intersection with a combining function.

intersection :: KeyMap a -> KeyMap b -> KeyMap a #

The (left-biased) intersection of two maps (based on keys).

unionWithKey :: (Key -> v -> v -> v) -> KeyMap v -> KeyMap v -> KeyMap v #

The union with a combining function.

unionWith :: (v -> v -> v) -> KeyMap v -> KeyMap v -> KeyMap v #

The union with a combining function.

union :: KeyMap v -> KeyMap v -> KeyMap v #

difference :: KeyMap v -> KeyMap v' -> KeyMap v #

Difference of two maps. Return elements of the first map not existing in the second.

toAscList :: KeyMap v -> [(Key, v)] #

Return a list of this map's elements in ascending order based of the textual key.

elems :: KeyMap v -> [v] #

Return a list of this map' elements.

Since: aeson-2.0.2.0

toList :: KeyMap v -> [(Key, v)] #

Return a list of this map's keys and elements.

The order is not stable. Use toAscList for stable ordering.

fromList :: [(Key, v)] -> KeyMap v #

Construct a map with the supplied mappings. If the list contains duplicate mappings, the later mappings take precedence.

fromListWith :: (v -> v -> v) -> [(Key, v)] -> KeyMap v #

Construct a map from a list of elements. Uses the provided function, f, to merge duplicate entries with (f newVal oldVal).

traverseWithKey :: Applicative f => (Key -> v1 -> f v2) -> KeyMap v1 -> f (KeyMap v2) #

Perform an Applicative action for each key-value pair in a KeyMap and produce a KeyMap of all the results.

traverse :: Applicative f => (v1 -> f v2) -> KeyMap v1 -> f (KeyMap v2) #

Perform an Applicative action for each key-value pair in a KeyMap and produce a KeyMap of all the results.

foldrWithKey :: (Key -> v -> a -> a) -> a -> KeyMap v -> a #

Reduce this map by applying a binary operator to all elements, using the given starting value (typically the right-identity of the operator).

foldl' :: (b -> a -> b) -> b -> KeyMap a -> b #

foldl :: (b -> a -> b) -> b -> KeyMap a -> b #

foldr' :: (a -> b -> b) -> b -> KeyMap a -> b #

foldr :: (a -> b -> b) -> b -> KeyMap a -> b #

foldMapWithKey :: Monoid m => (Key -> a -> m) -> KeyMap a -> m #

insert :: Key -> v -> KeyMap v -> KeyMap v #

Associate the specified value with the specified key in this map. If this map previously contained a mapping for the key, the old value is replaced.

lookup :: Key -> KeyMap v -> Maybe v #

Return the value to which the specified key is mapped, or Nothing if this map contains no mapping for the key.

alterF :: Functor f => (Maybe v -> f (Maybe v)) -> Key -> KeyMap v -> f (KeyMap v) #

alterF can be used to insert, delete, or update a value in a map.

delete :: Key -> KeyMap v -> KeyMap v #

Remove the mapping for the specified key from this map if present.

member :: Key -> KeyMap a -> Bool #

Is the key a member of the map?

singleton :: Key -> v -> KeyMap v #

Construct a map with a single element.

size :: KeyMap v -> Int #

Return the number of key-value mappings in this map.

null :: KeyMap v -> Bool #

Is the map empty?

empty :: KeyMap v #

Construct an empty map.

data KeyMap v #

A map from JSON key type Key to v.

Instances

Instances details
Functor KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

fmap :: (a -> b) -> KeyMap a -> KeyMap b #

(<$) :: a -> KeyMap b -> KeyMap a #

Foldable KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

fold :: Monoid m => KeyMap m -> m #

foldMap :: Monoid m => (a -> m) -> KeyMap a -> m #

foldMap' :: Monoid m => (a -> m) -> KeyMap a -> m #

foldr :: (a -> b -> b) -> b -> KeyMap a -> b #

foldr' :: (a -> b -> b) -> b -> KeyMap a -> b #

foldl :: (b -> a -> b) -> b -> KeyMap a -> b #

foldl' :: (b -> a -> b) -> b -> KeyMap a -> b #

foldr1 :: (a -> a -> a) -> KeyMap a -> a #

foldl1 :: (a -> a -> a) -> KeyMap a -> a #

toList :: KeyMap a -> [a] #

null :: KeyMap a -> Bool #

length :: KeyMap a -> Int #

elem :: Eq a => a -> KeyMap a -> Bool #

maximum :: Ord a => KeyMap a -> a #

minimum :: Ord a => KeyMap a -> a #

sum :: Num a => KeyMap a -> a #

product :: Num a => KeyMap a -> a #

Traversable KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

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

sequenceA :: Applicative f => KeyMap (f a) -> f (KeyMap a) #

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

sequence :: Monad m => KeyMap (m a) -> m (KeyMap a) #

Arbitrary1 KeyMap

Since: aeson-2.0.3.0

Instance details

Defined in Data.Aeson.KeyMap

Methods

liftArbitrary :: Gen a -> Gen (KeyMap a) #

liftShrink :: (a -> [a]) -> KeyMap a -> [KeyMap a] #

KeyValue Object

Constructs a singleton KeyMap. For calling functions that demand an Object for constructing objects. To be used in conjunction with mconcat. Prefer to use object where possible.

Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

(.=) :: ToJSON v => Key -> v -> Object #

ToJSON1 KeyMap 
Instance details

Defined in Data.Aeson.Types.ToJSON

Methods

liftToJSON :: (a -> Value) -> ([a] -> Value) -> KeyMap a -> Value #

liftToJSONList :: (a -> Value) -> ([a] -> Value) -> [KeyMap a] -> Value #

liftToEncoding :: (a -> Encoding) -> ([a] -> Encoding) -> KeyMap a -> Encoding #

liftToEncodingList :: (a -> Encoding) -> ([a] -> Encoding) -> [KeyMap a] -> Encoding #

FromJSON1 KeyMap

Since: aeson-2.0.1.0

Instance details

Defined in Data.Aeson.Types.FromJSON

Methods

liftParseJSON :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser (KeyMap a) #

liftParseJSONList :: (Value -> Parser a) -> (Value -> Parser [a]) -> Value -> Parser [KeyMap a] #

Semialign KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

align :: KeyMap a -> KeyMap b -> KeyMap (These a b) #

alignWith :: (These a b -> c) -> KeyMap a -> KeyMap b -> KeyMap c #

Align KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

nil :: KeyMap a #

Zip KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

zip :: KeyMap a -> KeyMap b -> KeyMap (a, b) #

zipWith :: (a -> b -> c) -> KeyMap a -> KeyMap b -> KeyMap c #

Filterable KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

mapMaybe :: (a -> Maybe b) -> KeyMap a -> KeyMap b #

catMaybes :: KeyMap (Maybe a) -> KeyMap a #

filter :: (a -> Bool) -> KeyMap a -> KeyMap a #

Witherable KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

wither :: Applicative f => (a -> f (Maybe b)) -> KeyMap a -> f (KeyMap b) #

witherM :: Monad m => (a -> m (Maybe b)) -> KeyMap a -> m (KeyMap b) #

filterA :: Applicative f => (a -> f Bool) -> KeyMap a -> f (KeyMap a) #

witherMap :: Applicative m => (KeyMap b -> r) -> (a -> m (Maybe b)) -> KeyMap a -> m r #

FunctorWithIndex Key KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

imap :: (Key -> a -> b) -> KeyMap a -> KeyMap b #

FoldableWithIndex Key KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

ifoldMap :: Monoid m => (Key -> a -> m) -> KeyMap a -> m #

ifoldMap' :: Monoid m => (Key -> a -> m) -> KeyMap a -> m #

ifoldr :: (Key -> a -> b -> b) -> b -> KeyMap a -> b #

ifoldl :: (Key -> b -> a -> b) -> b -> KeyMap a -> b #

ifoldr' :: (Key -> a -> b -> b) -> b -> KeyMap a -> b #

ifoldl' :: (Key -> b -> a -> b) -> b -> KeyMap a -> b #

TraversableWithIndex Key KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

itraverse :: Applicative f => (Key -> a -> f b) -> KeyMap a -> f (KeyMap b) #

SemialignWithIndex Key KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

ialignWith :: (Key -> These a b -> c) -> KeyMap a -> KeyMap b -> KeyMap c #

ZipWithIndex Key KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

izipWith :: (Key -> a -> b -> c) -> KeyMap a -> KeyMap b -> KeyMap c #

FilterableWithIndex Key KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

imapMaybe :: (Key -> a -> Maybe b) -> KeyMap a -> KeyMap b #

ifilter :: (Key -> a -> Bool) -> KeyMap a -> KeyMap a #

WitherableWithIndex Key KeyMap 
Instance details

Defined in Data.Aeson.KeyMap

Methods

iwither :: Applicative f => (Key -> a -> f (Maybe b)) -> KeyMap a -> f (KeyMap b) #

iwitherM :: Monad m => (Key -> a -> m (Maybe b)) -> KeyMap a -> m (KeyMap b) #

ifilterA :: Applicative f => (Key -> a -> f Bool) -> KeyMap a -> f (KeyMap a) #

Lift v => Lift (KeyMap v :: Type) 
Instance details

Defined in Data.Aeson.KeyMap

Methods

lift :: KeyMap v -> Q Exp #

liftTyped :: KeyMap v -> Q (TExp (KeyMap v)) #

IsList (KeyMap v)

Since: aeson-2.0.2.0

Instance details

Defined in Data.Aeson.KeyMap

Associated Types

type Item (KeyMap v) #

Methods

fromList :: [Item (KeyMap v)] -> KeyMap v #

fromListN :: Int -> [Item (KeyMap v)] -> KeyMap v #

toList :: KeyMap v -> [Item (KeyMap v)] #

Eq v => Eq (KeyMap v) 
Instance details

Defined in Data.Aeson.KeyMap

Methods

(==) :: KeyMap v -> KeyMap v -> Bool #

(/=) :: KeyMap v -> KeyMap v -> Bool #

Data v => Data (KeyMap v) 
Instance details

Defined in Data.Aeson.KeyMap

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> KeyMap v -> c (KeyMap v) #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (KeyMap v) #

toConstr :: KeyMap v -> Constr #

dataTypeOf :: KeyMap v -> DataType #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (KeyMap v)) #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (KeyMap v)) #

gmapT :: (forall b. Data b => b -> b) -> KeyMap v -> KeyMap v #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> KeyMap v -> r #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> KeyMap v -> r #

gmapQ :: (forall d. Data d => d -> u) -> KeyMap v -> [u] #

gmapQi :: Int -> (forall d. Data d => d -> u) -> KeyMap v -> u #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> KeyMap v -> m (KeyMap v) #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyMap v -> m (KeyMap v) #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> KeyMap v -> m (KeyMap v) #

Ord v => Ord (KeyMap v) 
Instance details

Defined in Data.Aeson.KeyMap

Methods

compare :: KeyMap v -> KeyMap v -> Ordering #

(<) :: KeyMap v -> KeyMap v -> Bool #

(<=) :: KeyMap v -> KeyMap v -> Bool #

(>) :: KeyMap v -> KeyMap v -> Bool #

(>=) :: KeyMap v -> KeyMap v -> Bool #

max :: KeyMap v -> KeyMap v -> KeyMap v #

min :: KeyMap v -> KeyMap v -> KeyMap v #

Read v => Read (KeyMap v) 
Instance details

Defined in Data.Aeson.KeyMap

Show v => Show (KeyMap v) 
Instance details

Defined in Data.Aeson.KeyMap

Methods

showsPrec :: Int -> KeyMap v -> ShowS #

show :: KeyMap v -> String #

showList :: [KeyMap v] -> ShowS #

Semigroup (KeyMap v) 
Instance details

Defined in Data.Aeson.KeyMap

Methods

(<>) :: KeyMap v -> KeyMap v -> KeyMap v #

sconcat :: NonEmpty (KeyMap v) -> KeyMap v #

stimes :: Integral b => b -> KeyMap v -> KeyMap v #

Monoid (KeyMap v) 
Instance details

Defined in Data.Aeson.KeyMap

Methods

mempty :: KeyMap v #

mappend :: KeyMap v -> KeyMap v -> KeyMap v #

mconcat :: [KeyMap v] -> KeyMap v #

Function v => Function (KeyMap v)

Since: aeson-2.0.3.0

Instance details

Defined in Data.Aeson.KeyMap

Methods

function :: (KeyMap v -> b) -> KeyMap v :-> b #

Arbitrary v => Arbitrary (KeyMap v)

Since: aeson-2.0.3.0

Instance details

Defined in Data.Aeson.KeyMap

Methods

arbitrary :: Gen (KeyMap v) #

shrink :: KeyMap v -> [KeyMap v] #

CoArbitrary v => CoArbitrary (KeyMap v)

Since: aeson-2.0.3.0

Instance details

Defined in Data.Aeson.KeyMap

Methods

coarbitrary :: KeyMap v -> Gen b -> Gen b #

Hashable v => Hashable (KeyMap v) 
Instance details

Defined in Data.Aeson.KeyMap

Methods

hashWithSalt :: Int -> KeyMap v -> Int #

hash :: KeyMap v -> Int #

ToJSON v => ToJSON (KeyMap v) 
Instance details

Defined in Data.Aeson.Types.ToJSON

FromJSON v => FromJSON (KeyMap v)

Since: aeson-2.0.1.0

Instance details

Defined in Data.Aeson.Types.FromJSON

NFData v => NFData (KeyMap v) 
Instance details

Defined in Data.Aeson.KeyMap

Methods

rnf :: KeyMap v -> () #

type Item (KeyMap v) 
Instance details

Defined in Data.Aeson.KeyMap

type Item (KeyMap v) = (Key, v)