packages feed

protobuf-simple-0.1.0.0: test/Types/UInt32ListPacked.hs

-- Generated by protobuf-simple. DO NOT EDIT!
module Types.UInt32ListPacked where

import Control.Applicative ((<$>))
import Prelude ()
import qualified Data.ProtoBufInt as PB

newtype UInt32ListPacked = UInt32ListPacked
  { value :: PB.Seq PB.Word32
  } deriving (PB.Show, PB.Eq, PB.Ord)

instance PB.Default UInt32ListPacked where
  defaultVal = UInt32ListPacked
    { value = PB.defaultVal
    }

instance PB.Mergeable UInt32ListPacked where
  merge a b = UInt32ListPacked
    { value = PB.merge (value a) (value b)
    }

instance PB.Required UInt32ListPacked where
  reqTags _ = PB.fromList []

instance PB.WireMessage UInt32ListPacked where
  fieldToValue (PB.WireTag 1 PB.LenDelim) self = (\v -> self{value = PB.merge (value self) v}) <$> PB.getUInt32Packed
  fieldToValue (PB.WireTag 1 PB.VarInt) self = (\v -> self{value = PB.append (value self) v}) <$> PB.getUInt32
  fieldToValue tag self = PB.getUnknown tag self

  messageToFields self = do
    PB.putUInt32Packed (PB.WireTag 1 PB.LenDelim) (value self)