launchdarkly-server-sdk-4.1.0: Server-side SDK for integrating with LaunchDarkly
Safe HaskellNone
LanguageHaskell2010

LaunchDarkly.AesonCompat

Description

The LaunchDarkly SDK supports a subset of Aeson 1.x and 2.x. These two versions differ in their type signatures, but are otherwise largely compatible. To support both versions, we provide this compatibility module.

Depending on the version of Aeson you have installed, this module will expose a KeyMap type that is either

  • In the case of 1.x, a HashMap T.Text, or
  • In the case of 2.x, the new KeyMap type

The compatibility layer exposes common map operations that the SDK needs and may prove useful to customers. In nearly all instances, these are simple aliases for the underlying Aeson equivalents.

The Aeson 2.x KeyMap is keyed by a new Key type that does not exist in 1.x. To keep the API as consistent as possible, all functions requiring a key will provide a Text value. In the 2.x compatibility layer, we will convert it to a from the appropriate Key type as necessary.

Documentation

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

toList :: HashMap Text v -> [(Text, v)] Source #

adjustKey :: (v -> v) -> Text -> HashMap Text v -> HashMap Text v Source #

mapValues :: (v1 -> v2) -> HashMap Text v1 -> HashMap Text v2 Source #

mapWithKey :: (Text -> v1 -> v2) -> HashMap Text v1 -> HashMap Text v2 Source #

mapMaybeValues :: (v1 -> Maybe v2) -> HashMap Text v1 -> HashMap Text v2 Source #

foldrWithKey :: (Text -> v -> a -> a) -> a -> HashMap Text v -> a Source #