packages feed

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

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

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

newtype Fixed64Msg = Fixed64Msg
  { value :: PB.Word64
  } deriving (PB.Show, PB.Eq, PB.Ord)

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

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

instance PB.Required Fixed64Msg where
  reqTags _ = PB.fromList [PB.WireTag 1 PB.Bit64]

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

  messageToFields self = do
    PB.putFixed64 (PB.WireTag 1 PB.Bit64) (value self)