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