graphql-engine-1.0.0: GraphQL API over Postgres
Safe HaskellNone
LanguageHaskell2010

Data.HashMap.Strict.InsOrd.Autodocodec

Synopsis

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.