packages feed

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

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

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

newtype FloatList = FloatList
  { value :: PB.Seq PB.Float
  } deriving (PB.Show, PB.Eq, PB.Ord)

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

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

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

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

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