packages feed

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

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

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

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

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

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

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

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

  messageToFields self = do
    PB.putStringList (PB.WireTag 1 PB.LenDelim) (value self)