packages feed

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

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

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

newtype SInt64Msg = SInt64Msg
  { value :: PB.Int64
  } deriving (PB.Show, PB.Eq, PB.Ord)

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

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

instance PB.Required SInt64Msg where
  reqTags _ = PB.fromList [PB.WireTag 1 PB.VarInt]

instance PB.WireMessage SInt64Msg where
  fieldToValue (PB.WireTag 1 PB.VarInt) self = (\v -> self{value = PB.merge (value self) v}) <$> PB.getSInt64
  fieldToValue tag self = PB.getUnknown tag self

  messageToFields self = do
    PB.putSInt64 (PB.WireTag 1 PB.VarInt) (value self)