{-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE BangPatterns, DeriveDataTypeable, FlexibleInstances, MultiParamTypeClasses #-} module Gen.Caffe.ThresholdParameter where import Prelude ((+), (/)) import qualified Prelude as Prelude' import qualified Data.Typeable as Prelude' import qualified Data.Data as Prelude' import qualified Text.ProtocolBuffers.Header as P' import Language.Haskell.TH.Syntax import Control.Lens data ThresholdParameter = ThresholdParameter{threshold :: !(P'.Maybe P'.Float)} deriving (Prelude'.Show, Prelude'.Eq, Prelude'.Ord, Prelude'.Typeable, Prelude'.Data) makeLensesWith (lensRules & lensField .~ \_ _ name -> [TopName (mkName Prelude'.$ "_" Prelude'.++ nameBase name)]) ''ThresholdParameter instance P'.Mergeable ThresholdParameter where mergeAppend (ThresholdParameter x'1) (ThresholdParameter y'1) = ThresholdParameter (P'.mergeAppend x'1 y'1) instance P'.Default ThresholdParameter where defaultValue = ThresholdParameter (Prelude'.Just 0.0) instance P'.Wire ThresholdParameter where wireSize ft' self'@(ThresholdParameter x'1) = case ft' of 10 -> calc'Size 11 -> P'.prependMessageSize calc'Size _ -> P'.wireSizeErr ft' self' where calc'Size = (P'.wireSizeOpt 1 2 x'1) wirePut ft' self'@(ThresholdParameter x'1) = case ft' of 10 -> put'Fields 11 -> do P'.putSize (P'.wireSize 10 self') put'Fields _ -> P'.wirePutErr ft' self' where put'Fields = do P'.wirePutOpt 13 2 x'1 wireGet ft' = case ft' of 10 -> P'.getBareMessageWith update'Self 11 -> P'.getMessageWith update'Self _ -> P'.wireGetErr ft' where update'Self wire'Tag old'Self = case wire'Tag of 13 -> Prelude'.fmap (\ !new'Field -> old'Self{threshold = Prelude'.Just new'Field}) (P'.wireGet 2) _ -> let (field'Number, wire'Type) = P'.splitWireTag wire'Tag in P'.unknown field'Number wire'Type old'Self instance P'.MessageAPI msg' (msg' -> ThresholdParameter) ThresholdParameter where getVal m' f' = f' m' instance P'.GPB ThresholdParameter instance P'.ReflectDescriptor ThresholdParameter where getMessageInfo _ = P'.GetMessageInfo (P'.fromDistinctAscList []) (P'.fromDistinctAscList [13]) reflectDescriptorInfo _ = Prelude'.read "DescriptorInfo {descName = ProtoName {protobufName = FIName \".caffe.ThresholdParameter\", haskellPrefix = [MName \"Gen\"], parentModule = [MName \"Caffe\"], baseName = MName \"ThresholdParameter\"}, descFilePath = [\"Gen\",\"Caffe\",\"ThresholdParameter.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoFName {protobufName' = FIName \".caffe.ThresholdParameter.threshold\", haskellPrefix' = [MName \"Gen\"], parentModule' = [MName \"Caffe\",MName \"ThresholdParameter\"], baseName' = FName \"threshold\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 13}, packedTag = Nothing, wireTagLength = 1, isPacked = False, isRequired = False, canRepeat = False, mightPack = False, typeCode = FieldType {getFieldType = 2}, typeName = Nothing, hsRawDefault = Just \"0.0\", hsDefault = Just (HsDef'RealFloat (SRF'Rational (0 % 1)))}], keys = fromList [], extRanges = [], knownKeys = fromList [], storeUnknown = False, lazyFields = False}"