packages feed

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

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

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

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

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

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

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

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

  messageToFields self = do
    PB.putSFixed32Opt (PB.WireTag 1 PB.Bit32) (value self)