HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulelog-base-0.12.0.1Haskell2010

Log.Internal.Aeson.Compat

  • 2 types
  • 53 values
  • Packagelog-base-0.12.0.1
  • Exports55
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceKeyMap.hs
newtypenewtype KeyMap v
#

A map from JSON key type Key to v.

Instances37Functor, Foldable, Traversable, Arbitrary1, Align, Semialign, …
newtypenewtype Key
#
Instances27Eq, Data, Ord, Read, Show, IsString, …
valuelookup :: 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.

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

Map a function over all values in the map.

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

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

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

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

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

Example1 expression
fromList [("a", 'x'), ("a", 'y')]fromList [("a",'y')]
value(!?) :: KeyMap v -> Key -> Maybe v
#

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

This is a flipped version of lookup.

valuedelete :: Key -> KeyMap v -> KeyMap v
#

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

valueelems :: KeyMap v -> [v]
#

Return a list of this map' elements.

valuefoldrWithKey :: (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).

valuefromListWith :: (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).

valueinsert :: 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.

valueinsertWith :: (a -> a -> a) -> Key -> a -> KeyMap a -> KeyMap a
#

Insert with a function combining new and old values, taken in that order.

valuesize :: KeyMap v -> Int
#

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

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

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