protobuf-simple-0.1.0.0: test/Types/DoubleMsg.hs
-- Generated by protobuf-simple. DO NOT EDIT!
module Types.DoubleMsg where
import Control.Applicative ((<$>))
import Prelude ()
import qualified Data.ProtoBufInt as PB
newtype DoubleMsg = DoubleMsg
{ value :: PB.Double
} deriving (PB.Show, PB.Eq, PB.Ord)
instance PB.Default DoubleMsg where
defaultVal = DoubleMsg
{ value = PB.defaultVal
}
instance PB.Mergeable DoubleMsg where
merge a b = DoubleMsg
{ value = PB.merge (value a) (value b)
}
instance PB.Required DoubleMsg where
reqTags _ = PB.fromList [PB.WireTag 1 PB.Bit64]
instance PB.WireMessage DoubleMsg where
fieldToValue (PB.WireTag 1 PB.Bit64) self = (\v -> self{value = PB.merge (value self) v}) <$> PB.getDouble
fieldToValue tag self = PB.getUnknown tag self
messageToFields self = do
PB.putDouble (PB.WireTag 1 PB.Bit64) (value self)