module Flat.Instances.DList
  ()
where
import           Data.DList          (DList, fromList, toList)
import           Flat.Class          (Flat (..))
import           Flat.Instances.Mono (decodeList, encodeList, sizeList)
instance Flat a => Flat (DList a) where
  size :: DList a -> NumBits -> NumBits
size   = forall mono.
(MonoFoldable mono, Flat (Element mono)) =>
mono -> NumBits -> NumBits
sizeList forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. DList a -> [a]
toList
  encode :: DList a -> Encoding
encode = forall mono.
(Flat (Element mono), MonoFoldable mono) =>
mono -> Encoding
encodeList forall b c a. (b -> c) -> (a -> b) -> a -> c
. forall a. DList a -> [a]
toList
  decode :: Get (DList a)
decode = forall a. [a] -> DList a
fromList forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> forall b. (IsSequence b, Flat (Element b)) => Get b
decodeList