Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- sortedElemsCodec :: (HasCodec a, Hashable k, Ord k) => (a -> k) -> JSONCodec (InsOrdHashMap k a)
- sortedElemsCodecWith :: (Hashable k, Ord k) => JSONCodec a -> (a -> k) -> JSONCodec (InsOrdHashMap k a)
Documentation
sortedElemsCodec :: (HasCodec a, Hashable k, Ord k) => (a -> k) -> JSONCodec (InsOrdHashMap k a) Source #
Codec for ordered hash maps where the key for each element can be inferred from the element value. This codec serializes the hash map as an array sorted by key.
sortedElemsCodecWith :: (Hashable k, Ord k) => JSONCodec a -> (a -> k) -> JSONCodec (InsOrdHashMap k a) Source #
Codec for ordered hash maps where the key for each element can be inferred from the element value. This codec serializes the hash map as an array sorted by key.
This version is useful if there is no HasCodec
instance for the type of the
hash map values. You supply a codec as an argument instead.