packages feed

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

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

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

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

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

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

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

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

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