module Flat.Instances.Unordered
()
where
import Flat.Instances.Mono
import Flat.Instances.Util
import Data.HashSet
import Data.Hashable
import qualified Data.HashMap.Strict as MS
instance (Hashable a, Eq a,Flat a) => Flat (HashSet a) where
size :: HashSet a -> NumBits -> NumBits
size = forall set. (IsSet set, Flat (Element set)) => Size set
sizeSet
encode :: HashSet a -> Encoding
encode = forall set. (IsSet set, Flat (Element set)) => set -> Encoding
encodeSet
decode :: Get (HashSet a)
decode = forall set. (IsSet set, Flat (Element set)) => Get set
decodeSet
instance (Hashable k,Eq k,Flat k,Flat v) => Flat (MS.HashMap k v) where
size :: HashMap k v -> NumBits -> NumBits
size = forall r.
(Flat (ContainerKey r), Flat (MapValue r), IsMap r) =>
Size r
sizeMap
encode :: HashMap k v -> Encoding
encode = forall map.
(Flat (ContainerKey map), Flat (MapValue map), IsMap map) =>
map -> Encoding
encodeMap
decode :: Get (HashMap k v)
decode = forall map.
(Flat (ContainerKey map), Flat (MapValue map), IsMap map) =>
Get map
decodeMap