packages feed

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

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

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

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

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

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

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

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

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