packages feed

protocol-buffers 0.2.9 → 0.3.1

raw patch · 98 files changed

+513/−9169 lines, 98 files

Files

README view
@@ -1,6 +1,6 @@ This the README file for protocol-buffers, protocol-buffers-descriptors, and hprotoc. These are three interdependent Haskell packages by Chris Kuklewicz.-This README was updated most recently to reflect version 0.2.8+This README was updated most recently to reflect version 0.3.1  Questions and answers: @@ -14,14 +14,12 @@ How well does this Haskell package duplicate Google's project?    This provides non-mutable messages that ought to be wire-compatible with Google.-  These message support extensions.-  These messages do not support reading or storing unknown fields; these are errors.+  These messages support extensions.+  These messages support unknown fields if hprotoc is passed the proper flag.   This does not generate anything for Services/Methods. -  Adding support for unknown fields as an option to hprotoc could be done.   Adding support for services has not been considered. -  I reject negative field numbers in proto files.  Google's code silently changes them to positive numbers.   I think that Google's code checks for some policy violations that are not well documented enough for me to reverse engineer.   Some (all?) of Google's APIs include the possibility of mutable messages.   I suspect that my message reflection is not as useful at runtime as in some of Google's APIs.@@ -79,7 +77,7 @@    hprotoc generates and uses the Text.DescriptorProtos tree from Google "descriptor.proto" file. -  hprotoc has generated code from Google/protobuf/unittest.proto and Google/protobuf.unittest_import.  These compile after adding hs-boot files TestAllExtensions.hs-boot, TestFieldOrderings.hs-boot, and TestMutualRecursionA.hs-boot to resolve mutual recursion.  The SPARSE_D and SPARSE_E enum values in the original unittest.proto are negative, which is disallowed so I comment those out.  The TestEnumWithDupValue has duplicated values which cause a compilation warning.+  hprotoc has generated code from Google/protobuf/unittest.proto and Google/protobuf.unittest_import.  These compile after adding hs-boot files TestAllExtensions.hs-boot, TestFieldOrderings.hs-boot, and TestMutualRecursionA.hs-boot to resolve mutual recursion.  The TestEnumWithDupValue has duplicated values which cause a compilation warning.    There has been QuickCheck tests done for UnittestProto/TestAllType.hs and UnittestProto/TestAllExtensions.hs in the tests subdirectory.  These pass as of 2008-09-19 for version 0.2.7 (which has been tagged right after writing this).  These test that random messages can be roundtripped to the wire format without changing — with the caveat that the new extension keys are read back as raw bytes but compare equal because of the parsing done by (==). 
TODO view
@@ -1,14 +1,8 @@-Add the rest of the documentation for the public API.+How does protoc parse enum options and enum value options??  In the new version! -Next task: re-organize code-  Goals:-    1) A command-line code generation tool-       a) CLI input-       b) lexer - parsers - resolver - reflector - generator-       c) importer-    2) Refine Header API used by generated classes-    3) A master API module to expose:-       a) Get/Set/Has/Ext/Default/Merge API-       b) Wire API-       c) Reflection API-       d) API for extensions?+Add even more of the documentation for the public API.+add check to getBareMessageWith for fieldId of stop group tag?+delete commented out code+add strictness annotations to internal data types.+benchmark+performance measure
Text/ProtocolBuffers/Extensions.hs view
@@ -22,27 +22,27 @@   -- * External types and classes   , Key(..),ExtKey(..),MessageAPI(..)   -- * Internal types, functions, and classes-  , wireSizeExtField,wirePutExtField,getMessageExt,getBareMessageExt+  , wireSizeExtField,wirePutExtField,getMessageExt,getBareMessageExt,loadExtension   , GPB,ExtField(..),ExtendMessage(..)   ) where -import Data.Map(Map)+import qualified Data.ByteString.Lazy as L+import qualified Data.Foldable as F import Data.Generics import Data.Ix(inRange)+import Data.Map(Map)+import qualified Data.Map as M import Data.Maybe(fromMaybe)-import Data.Typeable import Data.Monoid(mappend) import Data.Sequence(Seq,(|>)) import qualified Data.Sequence as Seq-import qualified Data.ByteString.Lazy as L-import qualified Data.Foldable as F-import qualified Data.Map as M+import Data.Typeable  import Text.ProtocolBuffers.Basic import Text.ProtocolBuffers.Default() import Text.ProtocolBuffers.WireMessage import Text.ProtocolBuffers.Reflections-import Text.ProtocolBuffers.Get as Get (Get,runGet,Result(..),lookAhead,getLazyByteString,spanOf,skip,bytesRead)+import Text.ProtocolBuffers.Get as Get (Get,runGet,Result(..),bytesRead)  err :: String -> b err msg = error $ "Text.ProtocolBuffers.Extensions error\n"++msg@@ -114,23 +114,24 @@ -- | The 'GPDyn' is my specialization of 'Dynamic'.  It hides the type -- with an existential but the 'GPWitness' brings the class instances -- into scope.  This is used in 'ExtOptional' for optional fields.-data GPDyn = forall a . GPDyn (GPWitness a) a+data GPDyn = forall a . GPDyn !(GPWitness a) a   deriving (Typeable)  -- | The 'GPDynSeq' is another specialization of 'Dynamic' and is used -- in 'ExtRepeated' for repeated fields.-data GPDynSeq = forall a . GPDynSeq (GPWitness a) (Seq a)+data GPDynSeq = forall a . GPDynSeq !(GPWitness a) !(Seq a)   deriving (Typeable)  -- | The WireType is used to ensure the Seq is homogenous. -- The ByteString is the unparsed input after the tag. -- The WireSize includes all tags.-data ExtFieldValue = ExtFromWire WireType (Seq ByteString)-                   | ExtOptional FieldType GPDyn-                   | ExtRepeated FieldType GPDynSeq+data ExtFieldValue = ExtFromWire !WireType !(Seq ByteString)+                   | ExtOptional !FieldType !GPDyn+                   | ExtRepeated !FieldType !GPDynSeq   deriving (Typeable,Ord,Show)  data DummyMessageType deriving (Typeable)+ instance ExtendMessage DummyMessageType where   getExtField = undefined   putExtField = undefined@@ -519,35 +520,35 @@ -- | This is used by the generated code wireSizeExtField :: ExtField -> WireSize wireSizeExtField (ExtField m) = F.foldl' aSize 0 (M.assocs m)  where-    aSize old (fi,(ExtFromWire wt bs)) = old +-      let tagSize = size'Varint (getWireTag (mkWireTag fi wt))-      in F.foldl' (\oldVal new -> oldVal + L.length new) (fromIntegral (Seq.length bs) * tagSize) bs-    aSize old (fi,(ExtOptional ft (GPDyn GPWitness d))) = old +-      let tagSize = size'Varint (getWireTag (toWireTag fi ft))-      in wireSizeReq tagSize ft d-    aSize old (fi,(ExtRepeated ft (GPDynSeq GPWitness s))) = old +-      let tagSize = size'Varint (getWireTag (toWireTag fi ft))-      in wireSizeRep tagSize ft s+  aSize old (fi,(ExtFromWire wt raw)) = old ++    let tagSize = size'Varint (getWireTag (mkWireTag fi wt))+    in F.foldl' (\oldVal new -> oldVal + L.length new) (fromIntegral (Seq.length raw) * tagSize) raw+  aSize old (fi,(ExtOptional ft (GPDyn GPWitness d))) = old ++    let tagSize = size'Varint (getWireTag (toWireTag fi ft))+    in wireSizeReq tagSize ft d+  aSize old (fi,(ExtRepeated ft (GPDynSeq GPWitness s))) = old ++    let tagSize = size'Varint (getWireTag (toWireTag fi ft))+    in wireSizeRep tagSize ft s  -- | This is used by the generated code. The data is serialized in -- order of increasing field number. wirePutExtField :: ExtField -> Put wirePutExtField (ExtField m) = mapM_ aPut (M.assocs m) where-    aPut (fi,(ExtFromWire wt raw)) = F.mapM_ (\bs -> putVarUInt (getWireTag $ mkWireTag fi wt) >> putLazyByteString bs) raw-    aPut (fi,(ExtOptional ft (GPDyn GPWitness d))) = wirePutOpt (toWireTag fi ft) ft (Just d)-    aPut (fi,(ExtRepeated ft (GPDynSeq GPWitness s))) = wirePutRep (toWireTag fi ft) ft s+  aPut (fi,(ExtFromWire wt raw)) = F.mapM_ (\bs -> putVarUInt (getWireTag $ mkWireTag fi wt) >> putLazyByteString bs) raw+  aPut (fi,(ExtOptional ft (GPDyn GPWitness d))) = wirePutOpt (toWireTag fi ft) ft (Just d)+  aPut (fi,(ExtRepeated ft (GPDynSeq GPWitness s))) = wirePutRep (toWireTag fi ft) ft s  -- | This is used by the generated code to get messages that have extensions getMessageExt :: (Mergeable message, ReflectDescriptor message,Typeable message,ExtendMessage message)               => (FieldId -> message -> Get message)           -- handles "allowed" wireTags               -> Get message-getMessageExt = getMessageWith extension+getMessageExt = getMessageWith loadExtension  -- | This is used by the generated code to get messages that have extensions getBareMessageExt :: (Mergeable message, ReflectDescriptor message,Typeable message,ExtendMessage message)                   => (FieldId -> message -> Get message)           -- handles "allowed" wireTags                   -> Get message-getBareMessageExt = getBareMessageWith extension+getBareMessageExt = getBareMessageWith loadExtension  -- | 'isValidExt' is used by 'extension' to check whether the field -- number is in one of the ranges declared in the '.proto' file.@@ -557,8 +558,8 @@  -- | get a value from the wire into the message's ExtField. This is -- used by 'getMessageExt' and 'getBareMessageExt' above.-extension :: (ReflectDescriptor a, ExtendMessage a) => FieldId -> WireType -> a -> Get a-extension fieldId wireType msg | isValidExt fieldId msg = do+loadExtension :: (ReflectDescriptor a, ExtendMessage a) => FieldId -> WireType -> a -> Get a+loadExtension fieldId wireType msg | isValidExt fieldId msg = do   let (ExtField ef) = getExtField msg       badwt wt = do here <- bytesRead                     fail $ "Conflicting wire types at byte position "++show here ++ " for extension to message: "++show (typeOf msg,fieldId,wireType,wt)@@ -586,46 +587,8 @@       let v' = ExtRepeated ft (GPDynSeq x (s |> a))           ef' = M.insert fieldId v' ef       seq v' $ seq ef' $ return (putExtField (ExtField ef') msg)-extension fieldId wireType msg = unknown fieldId wireType msg---- | This reads in the raw bytestring corresponding to an field known--- only through the wiretag's 'FieldId' and 'WireType'.-wireGetFromWire :: FieldId -> WireType -> Get ByteString-wireGetFromWire fi wt = getLazyByteString =<< calcLen where-  calcLen = case wt of-              0 -> lenOf (spanOf (>=128) >> skip 1)-              1 -> return 8-              2 -> lookAhead $ do-                     here <- bytesRead-                     len <- getVarInt-                     there <- bytesRead-                     return ((there-here)+len)-              3 -> lenOf (skipGroup fi)-              4 -> fail $ "Cannot wireGetFromWire with wireType of STOP_GROUP: "++show (fi,wt)-              5 -> return 4-              wtf -> fail $ "Invalid wire type (expected 0,1,2,3,or 5) found: "++show (fi,wtf)-  lenOf g = do here <- bytesRead-               there <- lookAhead (g >> bytesRead)-               return (there-here)+loadExtension fieldId wireType msg = unknown fieldId wireType msg --- | After a group start tag with the given 'FieldId' this will skip--- ahead in the stream past the end tag of that group.  Used by--- 'wireGetFromWire' to help compule the length of an unknown field--- when loading an extension.-skipGroup :: FieldId -> Get ()-skipGroup start_fi = go where-  go = do-    (fieldId,wireType) <- fmap (splitWireTag . WireTag) getVarInt-    case wireType of-      0 -> spanOf (>=128) >> skip 1 >> go-      1 -> skip 8 >> go-      2 -> getVarInt >>= skip >> go-      3 -> skipGroup fieldId >> go-      4 | start_fi /= fieldId -> fail $ "skipGroup failed, fieldId mismatch bewteen START_GROUP and STOP_GROUP: "++show (start_fi,(fieldId,wireType))-        | otherwise -> return ()-      5 -> skip 4 >> go-      wtf -> fail $ "Invalid wire type (expected 0,1,2,3,4,or 5) found: "++show (fieldId,wtf)-                      class MessageAPI msg a b | msg a -> b where   -- | Access data in a message.  The first argument is always the   -- message.  The second argument can be one of 4 categories.
Text/ProtocolBuffers/Get.hs view
@@ -26,7 +26,7 @@ -- contination; it should return failure or finished. -- -- 'suspendUntilComplete' repeatedly uses a partial continuation to--- ask for more input until Nothing is passed and then it proceeds+-- ask for more input until 'Nothing' is passed and then it proceeds -- with parsing. -- -- The 'getAvailable' command returns the lazy byte string the parser@@ -391,14 +391,15 @@ isReallyEmpty :: Get Bool isReallyEmpty = do   b <- isEmpty-  if not b then return b-    else loop+  if b then loop+    else return b  where loop = do          continue <- suspend-         b <- isEmpty-         if not b then return b-           else if continue then loop-                  else return False+         if continue+           then do b <- isEmpty+                   if b then loop+                     else return b+           else return True  spanOf :: (Word8 -> Bool) ->  Get (L.ByteString) spanOf f = do let loop = do (S ss bs n) <- getFull
Text/ProtocolBuffers/Header.hs view
@@ -12,6 +12,7 @@     , module Text.ProtocolBuffers.Basic     , module Text.ProtocolBuffers.Extensions     , module Text.ProtocolBuffers.Reflections+    , module Text.ProtocolBuffers.Unknown     , module Text.ProtocolBuffers.WireMessage     ) where @@ -24,15 +25,22 @@  import Text.ProtocolBuffers.Basic -- all import Text.ProtocolBuffers.Default()-import Text.ProtocolBuffers.Extensions(wireSizeExtField,wirePutExtField,GPB,getMessageExt,getBareMessageExt,Key(..),ExtField,ExtendMessage(..),MessageAPI(..),ExtKey(wireGetKey))+import Text.ProtocolBuffers.Extensions+  ( wireSizeExtField,wirePutExtField,loadExtension,getMessageExt,getBareMessageExt+  , GPB,Key(..),ExtField,ExtendMessage(..),MessageAPI(..),ExtKey(wireGetKey) ) import Text.ProtocolBuffers.Mergeable()-import Text.ProtocolBuffers.Reflections(ReflectDescriptor(..),ReflectEnum(..),EnumInfo(..),ProtoName(..),DescriptorInfo(extRanges))-import Text.ProtocolBuffers.WireMessage( prependMessageSize,putSize-                                       , wireSizeReq,wireSizeOpt,wireSizeRep-                                       , wirePutReq,wirePutOpt,wirePutRep-                                       , getMessage,getBareMessage-                                       , wireSizeErr,wirePutErr,wireGetErr-                                       , unknownField)+import Text.ProtocolBuffers.Reflections+  ( ReflectDescriptor(..),ReflectEnum(..),EnumInfo(..),ProtoName(..),DescriptorInfo(extRanges) )+import Text.ProtocolBuffers.Unknown+  ( UnknownField,UnknownMessage(..),wireSizeUnknownField,wirePutUnknownField,loadUnknown )+import Text.ProtocolBuffers.WireMessage+  ( prependMessageSize,putSize+  , wireSizeReq,wireSizeOpt,wireSizeRep+  , wirePutReq,wirePutOpt,wirePutRep+  , getMessage,getBareMessage+  , getMessageWith,getBareMessageWith+  , wireSizeErr,wirePutErr,wireGetErr+  , unknown,unknownField)  append :: Seq a -> a -> Seq a append = (|>)
Text/ProtocolBuffers/Reflections.hs view
@@ -54,6 +54,7 @@                                      , keys :: Seq KeyInfo                                      , extRanges :: [(FieldId,FieldId)]                                      , knownKeys :: Seq FieldInfo+                                     , storeUnknown :: Bool                                      }   deriving (Show,Read,Eq,Ord,Data,Typeable) 
+ Text/ProtocolBuffers/Unknown.hs view
@@ -0,0 +1,101 @@+-- | This module add unknown field supprt to the library+--+-- This should support+--  1) Storing unknown bytestrings in messages+--     a) Mergeable+--     b) Default+--     c) Show+--  2) loading the unknown bytestrings into a (Map FieldId) from wire+--     a) If wiretypes differ this is an error so report it+--     b) Take extra care to ensure a _copy_ of the input is kept (?)+--  3) save unknown bytestring back to the wire+--  4) API ?+--      a) Provide ability to "wireGet" the data as a real type+--      b) clear the data+--      c) has any unkown data ?+--  5) Extend reflection to indicate presence of support for unkown data+--  6) Extend Options and command line to flag this+--  7) Extend hprotoc to add in this field+module Text.ProtocolBuffers.Unknown+  ( UnknownField(..),UnknownMessage(..),UnknownFieldValue(..),wireSizeUnknownField,wirePutUnknownField,loadUnknown+  ) where++import qualified Data.ByteString.Lazy as L+import qualified Data.Foldable as F+import Data.Generics+import Data.Map(Map)+import qualified Data.Map as M+import Data.Monoid(mappend)+import Data.Sequence(Seq,(|>))+import qualified Data.Sequence as Seq+import Data.Typeable++import Text.ProtocolBuffers.Basic+import Text.ProtocolBuffers.WireMessage+import Text.ProtocolBuffers.Get as Get (Get,bytesRead)++err :: String -> b+err msg = error $ "Text.ProtocolBuffers.Unknown error\n"++msg++class UnknownMessage msg where+  getUnknownField :: msg -> UnknownField+  putUnknownField :: UnknownField -> msg -> msg++newtype UnknownField = UnknownField (Map FieldId UnknownFieldValue)+  deriving (Eq,Ord,Show,Read,Data,Typeable)++data UnknownFieldValue = UFV !WireType !(Seq ByteString)+  deriving (Eq,Ord,Show,Read,Data,Typeable)++instance Mergeable UnknownField where+  mergeEmpty = UnknownField M.empty+  mergeAppend (UnknownField m1) (UnknownField m2) = UnknownField (M.unionWith mergeUnknownFieldValue m1 m2)++mergeUnknownFieldValue :: UnknownFieldValue -> UnknownFieldValue -> UnknownFieldValue+mergeUnknownFieldValue (UFV wt1 s1) (UFV wt2 s2) =+  if wt1 /= wt2 then err $ "mergeUnknownFieldValue: WireType mismatch "++show (wt1,wt2)+    else UFV wt2 (mappend s1 s2)++instance Default UnknownField where+  defaultValue = UnknownField M.empty++-- | This is used by the generated code+wireSizeUnknownField :: UnknownField -> WireSize+wireSizeUnknownField (UnknownField m) = F.foldl' aSize 0 (M.assocs m)  where+  aSize old (fi,(UFV wt raw)) = old ++    let tagSize = size'Varint (getWireTag (mkWireTag fi wt))+    in F.foldl' (\oldVal new -> oldVal + L.length new) (fromIntegral (Seq.length raw) * tagSize) raw++-- | This is used by the generated code+wirePutUnknownField :: UnknownField -> Put+wirePutUnknownField (UnknownField m) = mapM_ aPut (M.assocs m) where+  aPut (fi,(UFV wt raw)) = F.mapM_ (\bs -> putVarUInt (getWireTag $ mkWireTag fi wt) >> putLazyByteString bs) raw++{-+getMessageUnknown :: (Mergeable message, ReflectDescriptor message,Typeable message,ExtendMessage message)+                  => (FieldId -> message -> Get message)+                  -> Get message+getMessageUnknown = getMessageWith loadUnknown++getBareMessageUnknown :: (Mergeable message, ReflectDescriptor message,Typeable message,ExtendMessage message)+                      => (FieldId -> message -> Get message)+                      -> Get message+getBareMessageUnknown = getBareMessageWith loadUnknown+-}+loadUnknown :: (Typeable a, UnknownMessage a) => FieldId -> WireType -> a -> Get a+loadUnknown fieldId wireType msg = do+  let (UnknownField uf) = getUnknownField msg+      badwt wt = do here <- bytesRead+                    fail $ "Conflicting wire types at byte position "++show here ++ " for unknown field of message: "++show (typeOf msg,fieldId,wireType,wt)+  case M.lookup fieldId uf of+    Nothing -> do+      bs <- wireGetFromWire fieldId wireType+      let v' = UFV wireType (Seq.singleton bs)+          uf' = M.insert fieldId v' uf+      seq v' $ seq uf' $ return $ putUnknownField (UnknownField uf') msg+    Just (UFV wt raw) | wt /= wireType -> badwt wt+                                    | otherwise -> do+      bs <- wireGetFromWire fieldId wireType+      let v' = UFV wt (raw |> bs)+          uf' = M.insert fieldId v' uf+      seq v' $ seq uf' $ return $ putUnknownField (UnknownField uf') msg
Text/ProtocolBuffers/WireMessage.hs view
@@ -27,29 +27,30 @@     , wirePutReq,wirePutOpt,wirePutRep     , wireSizeErr,wirePutErr,wireGetErr     , getMessage,getBareMessage,getMessageWith,getBareMessageWith-    , unknownField,unknown+    , unknownField,unknown,wireGetFromWire     , castWord64ToDouble,castWord32ToFloat,castDoubleToWord64,castFloatToWord32     , zzEncode64,zzEncode32,zzDecode64,zzDecode32     ) where  -- GHC internals for getting at Double and Float representation as Word64 and Word32 import Control.Monad(when)+import Control.Monad.ST+import Data.Array.ST import Data.Bits (Bits(..)) import qualified Data.ByteString.Lazy as BS (length) import qualified Data.Foldable as F(foldl',forM_) import Data.List (genericLength) import qualified Data.Set as Set(notMember,delete,null) import Data.Typeable (Typeable(..))-import Foreign(alloca,peek,poke,castPtr)-import GHC.Exts (Double(D#),Float(F#),unsafeCoerce#)-import GHC.Word (Word64(W64#)) -- ,Word32(W32#))-import System.IO.Unsafe(unsafePerformIO)+--import GHC.Exts (Double(D#),Float(F#),unsafeCoerce#)+--import GHC.Word (Word64(W64#)) -- ,Word32(W32#))  -- binary package import Data.Binary.Put (Put,runPut,putWord8,putWord32le,putWord64le,putLazyByteString)  import Text.ProtocolBuffers.Basic import Text.ProtocolBuffers.Get as Get (Result(..),Get,runGet,bytesRead,isReallyEmpty+                                       ,spanOf,skip,lookAhead                                        ,getWord8,getWord32le,getWord64le,getLazyByteString) import Text.ProtocolBuffers.Mergeable() import Text.ProtocolBuffers.Reflections(ReflectDescriptor(reflectDescriptorInfo,getMessageInfo)@@ -163,17 +164,17 @@                         Left msg -> error msg                         Right (r,_) -> r --- This is like 'runGet' but any 'Result' of 'Partial' is converted in--- a @ Left "Not enoguh input" @ error.  Thus the 'ByteString'--- argument is taken to be the entire input.  To be able to--- incrementally feed in more input you should use 'runGet' and--- respond to 'Partial' differently.+-- This is like 'runGet', without the ability to pass in more input+-- beyond the initial ByteString.  Thus the 'ByteString' argument is+-- taken to be the entire input.  To be able to incrementally feed in+-- more input you should use 'runGet' and respond to 'Partial'+-- differently. runGetOnLazy :: Get r -> ByteString -> Either String (r,ByteString) runGetOnLazy parser bs = resolve (runGet parser bs)   where resolve :: Result r -> Either String (r,ByteString)         resolve (Failed i s) = Left ("Failed at "++show i++" : "++s)         resolve (Finished bsOut _i r) = Right (r,bsOut)-        resolve (Partial {}) = Left ("Not enough input")+        resolve (Partial op) = resolve (op Nothing)  -- | Used in generated code. prependMessageSize :: WireSize -> WireSize@@ -345,17 +346,21 @@ {-# INLINE castWord32ToFloat #-} castWord32ToFloat :: Word32 -> Float --castWord32ToFloat (W32# w) = F# (unsafeCoerce# w)-castWord32ToFloat x = unsafePerformIO $ alloca $ \p -> poke p x >> peek (castPtr p)+--castWord32ToFloat x = unsafePerformIO $ alloca $ \p -> poke p x >> peek (castPtr p)+castWord32ToFloat x = runST (newArray (0::Int,0) x >>= castSTUArray >>= flip readArray 0) {-# INLINE castFloatToWord32 #-} castFloatToWord32 :: Float -> Word32 --castFloatToWord32 (F# f) = W32# (unsafeCoerce# f)-castFloatToWord32 x = unsafePerformIO $ alloca $ \p -> poke p x >> peek (castPtr p)+castFloatToWord32 x = runST (newArray (0::Int,0) x >>= castSTUArray >>= flip readArray 0)+ {-# INLINE castWord64ToDouble #-} castWord64ToDouble :: Word64 -> Double-castWord64ToDouble (W64# w) = D# (unsafeCoerce# w)+-- castWord64ToDouble (W64# w) = D# (unsafeCoerce# w)+castWord64ToDouble x = runST (newArray (0::Int,0) x >>= castSTUArray >>= flip readArray 0) {-# INLINE castDoubleToWord64 #-} castDoubleToWord64 :: Double -> Word64-castDoubleToWord64 (D# d) = W64# (unsafeCoerce# d)+-- castDoubleToWord64 (D# d) = W64# (unsafeCoerce# d)+castDoubleToWord64 x = runST (newArray (0::Int,0) x >>= castSTUArray >>= flip readArray 0)  -- These error handlers are exported to the generated code wireSizeErr :: Typeable a => FieldType -> a -> WireSize@@ -554,7 +559,44 @@                         | otherwise = putWord8 (fromIntegral (i .&. 0x7F) .|. 0x80) >> go (i `shiftR` 7)                in go b +-- | This reads in the raw bytestring corresponding to an field known+-- only through the wiretag's 'FieldId' and 'WireType'.+wireGetFromWire :: FieldId -> WireType -> Get ByteString+wireGetFromWire fi wt = getLazyByteString =<< calcLen where+  calcLen = case wt of+              0 -> lenOf (spanOf (>=128) >> skip 1)+              1 -> return 8+              2 -> lookAhead $ do+                     here <- bytesRead+                     len <- getVarInt+                     there <- bytesRead+                     return ((there-here)+len)+              3 -> lenOf (skipGroup fi)+              4 -> fail $ "Cannot wireGetFromWire with wireType of STOP_GROUP: "++show (fi,wt)+              5 -> return 4+              wtf -> fail $ "Invalid wire type (expected 0,1,2,3,or 5) found: "++show (fi,wtf)+  lenOf g = do here <- bytesRead+               there <- lookAhead (g >> bytesRead)+               return (there-here)           +-- | After a group start tag with the given 'FieldId' this will skip+-- ahead in the stream past the end tag of that group.  Used by+-- 'wireGetFromWire' to help compule the length of an unknown field+-- when loading an extension.+skipGroup :: FieldId -> Get ()+skipGroup start_fi = go where+  go = do+    (fieldId,wireType) <- fmap (splitWireTag . WireTag) getVarInt+    case wireType of+      0 -> spanOf (>=128) >> skip 1 >> go+      1 -> skip 8 >> go+      2 -> getVarInt >>= skip >> go+      3 -> skipGroup fieldId >> go+      4 | start_fi /= fieldId -> fail $ "skipGroup failed, fieldId mismatch bewteen START_GROUP and STOP_GROUP: "++show (start_fi,(fieldId,wireType))+        | otherwise -> return ()+      5 -> skip 4 >> go+      wtf -> fail $ "Invalid wire type (expected 0,1,2,3,4,or 5) found: "++show (fieldId,wtf)+ {-   enum WireType {     WIRETYPE_VARINT           = 0,
+ descriptor.proto view
@@ -0,0 +1,286 @@+// Protocol Buffers - Google's data interchange format+// Copyright 2008 Google Inc.+// http://code.google.com/p/protobuf/+//+// Licensed under the Apache License, Version 2.0 (the "License");+// you may not use this file except in compliance with the License.+// You may obtain a copy of the License at+//+//      http://www.apache.org/licenses/LICENSE-2.0+//+// Unless required by applicable law or agreed to in writing, software+// distributed under the License is distributed on an "AS IS" BASIS,+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.+// See the License for the specific language governing permissions and+// limitations under the License.++// Author: kenton@google.com (Kenton Varda)+//  Based on original Protocol Buffers design by+//  Sanjay Ghemawat, Jeff Dean, and others.+//+// The messages in this file describe the definitions found in .proto files.+// A valid .proto file can be translated directly to a FileDescriptorProto+// without any other information (e.g. without reading its imports).++++package google.protobuf;+option java_package = "com.google.protobuf";+option java_outer_classname = "DescriptorProtos";++// descriptor.proto must be optimized for speed because reflection-based+// algorithms don't work during bootstrapping.+option optimize_for = SPEED;++// Describes a complete .proto file.+message FileDescriptorProto {+  optional string name = 1;       // file name, relative to root of source tree+  optional string package = 2;    // e.g. "foo", "foo.bar", etc.++  // Names of files imported by this file.+  repeated string dependency = 3;++  // All top-level definitions in this file.+  repeated DescriptorProto message_type = 4;+  repeated EnumDescriptorProto enum_type = 5;+  repeated ServiceDescriptorProto service = 6;+  repeated FieldDescriptorProto extension = 7;++  optional FileOptions options = 8;+}++// Describes a message type.+message DescriptorProto {+  optional string name = 1;++  repeated FieldDescriptorProto field = 2;+  repeated FieldDescriptorProto extension = 6;++  repeated DescriptorProto nested_type = 3;+  repeated EnumDescriptorProto enum_type = 4;++  message ExtensionRange {+    optional int32 start = 1;+    optional int32 end = 2;+  }+  repeated ExtensionRange extension_range = 5;++  optional MessageOptions options = 7;+}++// Describes a field within a message.+message FieldDescriptorProto {+  enum Type {+    // 0 is reserved for errors.+    // Order is weird for historical reasons.+    TYPE_DOUBLE         = 1;+    TYPE_FLOAT          = 2;+    TYPE_INT64          = 3;   // Not ZigZag encoded.  Negative numbers+                               // take 10 bytes.  Use TYPE_SINT64 if negative+                               // values are likely.+    TYPE_UINT64         = 4;+    TYPE_INT32          = 5;   // Not ZigZag encoded.  Negative numbers+                               // take 10 bytes.  Use TYPE_SINT32 if negative+                               // values are likely.+    TYPE_FIXED64        = 6;+    TYPE_FIXED32        = 7;+    TYPE_BOOL           = 8;+    TYPE_STRING         = 9;+    TYPE_GROUP          = 10;  // Tag-delimited aggregate.+    TYPE_MESSAGE        = 11;  // Length-delimited aggregate.++    // New in version 2.+    TYPE_BYTES          = 12;+    TYPE_UINT32         = 13;+    TYPE_ENUM           = 14;+    TYPE_SFIXED32       = 15;+    TYPE_SFIXED64       = 16;+    TYPE_SINT32         = 17;  // Uses ZigZag encoding.+    TYPE_SINT64         = 18;  // Uses ZigZag encoding.+  };++  enum Label {+    // 0 is reserved for errors+    LABEL_OPTIONAL      = 1;+    LABEL_REQUIRED      = 2;+    LABEL_REPEATED      = 3;+    // TODO(sanjay): Should we add LABEL_MAP?+  };++  optional string name = 1;+  optional int32 number = 3;+  optional Label label = 4;++  // If type_name is set, this need not be set.  If both this and type_name+  // are set, this must be either TYPE_ENUM or TYPE_MESSAGE.+  optional Type type = 5;++  // For message and enum types, this is the name of the type.  If the name+  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping+  // rules are used to find the type (i.e. first the nested types within this+  // message are searched, then within the parent, on up to the root+  // namespace).+  optional string type_name = 6;++  // For extensions, this is the name of the type being extended.  It is+  // resolved in the same manner as type_name.+  optional string extendee = 2;++  // For numeric types, contains the original text representation of the value.+  // For booleans, "true" or "false".+  // For strings, contains the default text contents (not escaped in any way).+  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.+  // TODO(kenton):  Base-64 encode?+  optional string default_value = 7;++  optional FieldOptions options = 8;+}++// Describes an enum type.+message EnumDescriptorProto {+  optional string name = 1;++  repeated EnumValueDescriptorProto value = 2;++  optional EnumOptions options = 3;+}++// Describes a value within an enum.+message EnumValueDescriptorProto {+  optional string name = 1;+  optional int32 number = 2;++  optional EnumValueOptions options = 3;+}++// Describes a service.+message ServiceDescriptorProto {+  optional string name = 1;+  repeated MethodDescriptorProto method = 2;++  optional ServiceOptions options = 3;+}++// Describes a method of a service.+message MethodDescriptorProto {+  optional string name = 1;++  // Input and output type names.  These are resolved in the same way as+  // FieldDescriptorProto.type_name, but must refer to a message type.+  optional string input_type = 2;+  optional string output_type = 3;++  optional MethodOptions options = 4;+}++// ===================================================================+// Options++// Each of the definitions above may have "options" attached.  These are+// just annotations which may cause code to be generated slightly differently+// or may contain hints for code that manipulates protocol messages.++// TODO(kenton):  Allow extensions to options.++message FileOptions {++  // Sets the Java package where classes generated from this .proto will be+  // placed.  By default, the proto package is used, but this is often+  // inappropriate because proto packages do not normally start with backwards+  // domain names.+  optional string java_package = 1;+++  // If set, all the classes from the .proto file are wrapped in a single+  // outer class with the given name.  This applies to both Proto1+  // (equivalent to the old "--one_java_file" option) and Proto2 (where+  // a .proto always translates to a single class, but you may want to+  // explicitly choose the class name).+  optional string java_outer_classname = 8;++  // If set true, then the Java code generator will generate a separate .java+  // file for each top-level message, enum, and service defined in the .proto+  // file.  Thus, these types will *not* be nested inside the outer class+  // named by java_outer_classname.  However, the outer class will still be+  // generated to contain the file's getDescriptor() method as well as any+  // top-level extensions defined in the file.+  optional bool java_multiple_files = 10 [default=false];++  // Generated classes can be optimized for speed or code size.+  enum OptimizeMode {+    SPEED = 1;      // Generate complete code for parsing, serialization, etc.+    CODE_SIZE = 2;  // Use ReflectionOps to implement these methods.+  }+  optional OptimizeMode optimize_for = 9 [default=CODE_SIZE];+}++message MessageOptions {+  // Set true to use the old proto1 MessageSet wire format for extensions.+  // This is provided for backwards-compatibility with the MessageSet wire+  // format.  You should not use this for any other reason:  It's less+  // efficient, has fewer features, and is more complicated.+  //+  // The message must be defined exactly as follows:+  //   message Foo {+  //     option message_set_wire_format = true;+  //     extensions 4 to max;+  //   }+  // Note that the message cannot have any defined fields; MessageSets only+  // have extensions.+  //+  // All extensions of your type must be singular messages; e.g. they cannot+  // be int32s, enums, or repeated messages.+  //+  // Because this is an option, the above two restrictions are not enforced by+  // the protocol compiler.+  optional bool message_set_wire_format = 1 [default=false];+}++message FieldOptions {+  // The ctype option instructs the C++ code generator to use a different+  // representation of the field than it normally would.  See the specific+  // options below.  This option is not yet implemented in the open source+  // release -- sorry, we'll try to include it in a future version!+  optional CType ctype = 1;+  enum CType {+    CORD = 1;++    STRING_PIECE = 2;+  }++  // EXPERIMENTAL.  DO NOT USE.+  // For "map" fields, the name of the field in the enclosed type that+  // is the key for this map.  For example, suppose we have:+  //   message Item {+  //     required string name = 1;+  //     required string value = 2;+  //   }+  //   message Config {+  //     repeated Item items = 1 [experimental_map_key="name"];+  //   }+  // In this situation, the map key for Item will be set to "name".+  // TODO: Fully-implement this, then remove the "experimental_" prefix.+  optional string experimental_map_key = 9;+}++message EnumOptions {+}++message EnumValueOptions {+}++message ServiceOptions {++  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC+  //   framework.  We apologize for hoarding these numbers to ourselves, but+  //   we were already using them long before we decided to release Protocol+  //   Buffers.+}++message MethodOptions {++  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC+  //   framework.  We apologize for hoarding these numbers to ourselves, but+  //   we were already using them long before we decided to release Protocol+  //   Buffers.+}
− descriptor/LICENSE
@@ -1,214 +0,0 @@-Copyright (c) 2008, Christopher Edward Kuklewicz-All rights reserved.--Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:--    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.-    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.-    * Neither the name of the copyright holder nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission.--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.--The descriptor.proto and unittest.proto files from google's code are under the Apache license (2.0):--                                 Apache License-                           Version 2.0, January 2004-                        http://www.apache.org/licenses/--   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION--   1. Definitions.--      "License" shall mean the terms and conditions for use, reproduction,-      and distribution as defined by Sections 1 through 9 of this document.--      "Licensor" shall mean the copyright owner or entity authorized by-      the copyright owner that is granting the License.--      "Legal Entity" shall mean the union of the acting entity and all-      other entities that control, are controlled by, or are under common-      control with that entity. For the purposes of this definition,-      "control" means (i) the power, direct or indirect, to cause the-      direction or management of such entity, whether by contract or-      otherwise, or (ii) ownership of fifty percent (50%) or more of the-      outstanding shares, or (iii) beneficial ownership of such entity.--      "You" (or "Your") shall mean an individual or Legal Entity-      exercising permissions granted by this License.--      "Source" form shall mean the preferred form for making modifications,-      including but not limited to software source code, documentation-      source, and configuration files.--      "Object" form shall mean any form resulting from mechanical-      transformation or translation of a Source form, including but-      not limited to compiled object code, generated documentation,-      and conversions to other media types.--      "Work" shall mean the work of authorship, whether in Source or-      Object form, made available under the License, as indicated by a-      copyright notice that is included in or attached to the work-      (an example is provided in the Appendix below).--      "Derivative Works" shall mean any work, whether in Source or Object-      form, that is based on (or derived from) the Work and for which the-      editorial revisions, annotations, elaborations, or other modifications-      represent, as a whole, an original work of authorship. For the purposes-      of this License, Derivative Works shall not include works that remain-      separable from, or merely link (or bind by name) to the interfaces of,-      the Work and Derivative Works thereof.--      "Contribution" shall mean any work of authorship, including-      the original version of the Work and any modifications or additions-      to that Work or Derivative Works thereof, that is intentionally-      submitted to Licensor for inclusion in the Work by the copyright owner-      or by an individual or Legal Entity authorized to submit on behalf of-      the copyright owner. For the purposes of this definition, "submitted"-      means any form of electronic, verbal, or written communication sent-      to the Licensor or its representatives, including but not limited to-      communication on electronic mailing lists, source code control systems,-      and issue tracking systems that are managed by, or on behalf of, the-      Licensor for the purpose of discussing and improving the Work, but-      excluding communication that is conspicuously marked or otherwise-      designated in writing by the copyright owner as "Not a Contribution."--      "Contributor" shall mean Licensor and any individual or Legal Entity-      on behalf of whom a Contribution has been received by Licensor and-      subsequently incorporated within the Work.--   2. Grant of Copyright License. Subject to the terms and conditions of-      this License, each Contributor hereby grants to You a perpetual,-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable-      copyright license to reproduce, prepare Derivative Works of,-      publicly display, publicly perform, sublicense, and distribute the-      Work and such Derivative Works in Source or Object form.--   3. Grant of Patent License. Subject to the terms and conditions of-      this License, each Contributor hereby grants to You a perpetual,-      worldwide, non-exclusive, no-charge, royalty-free, irrevocable-      (except as stated in this section) patent license to make, have made,-      use, offer to sell, sell, import, and otherwise transfer the Work,-      where such license applies only to those patent claims licensable-      by such Contributor that are necessarily infringed by their-      Contribution(s) alone or by combination of their Contribution(s)-      with the Work to which such Contribution(s) was submitted. If You-      institute patent litigation against any entity (including a-      cross-claim or counterclaim in a lawsuit) alleging that the Work-      or a Contribution incorporated within the Work constitutes direct-      or contributory patent infringement, then any patent licenses-      granted to You under this License for that Work shall terminate-      as of the date such litigation is filed.--   4. Redistribution. You may reproduce and distribute copies of the-      Work or Derivative Works thereof in any medium, with or without-      modifications, and in Source or Object form, provided that You-      meet the following conditions:--      (a) You must give any other recipients of the Work or-          Derivative Works a copy of this License; and--      (b) You must cause any modified files to carry prominent notices-          stating that You changed the files; and--      (c) You must retain, in the Source form of any Derivative Works-          that You distribute, all copyright, patent, trademark, and-          attribution notices from the Source form of the Work,-          excluding those notices that do not pertain to any part of-          the Derivative Works; and--      (d) If the Work includes a "NOTICE" text file as part of its-          distribution, then any Derivative Works that You distribute must-          include a readable copy of the attribution notices contained-          within such NOTICE file, excluding those notices that do not-          pertain to any part of the Derivative Works, in at least one-          of the following places: within a NOTICE text file distributed-          as part of the Derivative Works; within the Source form or-          documentation, if provided along with the Derivative Works; or,-          within a display generated by the Derivative Works, if and-          wherever such third-party notices normally appear. The contents-          of the NOTICE file are for informational purposes only and-          do not modify the License. You may add Your own attribution-          notices within Derivative Works that You distribute, alongside-          or as an addendum to the NOTICE text from the Work, provided-          that such additional attribution notices cannot be construed-          as modifying the License.--      You may add Your own copyright statement to Your modifications and-      may provide additional or different license terms and conditions-      for use, reproduction, or distribution of Your modifications, or-      for any such Derivative Works as a whole, provided Your use,-      reproduction, and distribution of the Work otherwise complies with-      the conditions stated in this License.--   5. Submission of Contributions. Unless You explicitly state otherwise,-      any Contribution intentionally submitted for inclusion in the Work-      by You to the Licensor shall be under the terms and conditions of-      this License, without any additional terms or conditions.-      Notwithstanding the above, nothing herein shall supersede or modify-      the terms of any separate license agreement you may have executed-      with Licensor regarding such Contributions.--   6. Trademarks. This License does not grant permission to use the trade-      names, trademarks, service marks, or product names of the Licensor,-      except as required for reasonable and customary use in describing the-      origin of the Work and reproducing the content of the NOTICE file.--   7. Disclaimer of Warranty. Unless required by applicable law or-      agreed to in writing, Licensor provides the Work (and each-      Contributor provides its Contributions) on an "AS IS" BASIS,-      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or-      implied, including, without limitation, any warranties or conditions-      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A-      PARTICULAR PURPOSE. You are solely responsible for determining the-      appropriateness of using or redistributing the Work and assume any-      risks associated with Your exercise of permissions under this License.--   8. Limitation of Liability. In no event and under no legal theory,-      whether in tort (including negligence), contract, or otherwise,-      unless required by applicable law (such as deliberate and grossly-      negligent acts) or agreed to in writing, shall any Contributor be-      liable to You for damages, including any direct, indirect, special,-      incidental, or consequential damages of any character arising as a-      result of this License or out of the use or inability to use the-      Work (including but not limited to damages for loss of goodwill,-      work stoppage, computer failure or malfunction, or any and all-      other commercial damages or losses), even if such Contributor-      has been advised of the possibility of such damages.--   9. Accepting Warranty or Additional Liability. While redistributing-      the Work or Derivative Works thereof, You may choose to offer,-      and charge a fee for, acceptance of support, warranty, indemnity,-      or other liability obligations and/or rights consistent with this-      License. However, in accepting such obligations, You may act only-      on Your own behalf and on Your sole responsibility, not on behalf-      of any other Contributor, and only if You agree to indemnify,-      defend, and hold each Contributor harmless for any liability-      incurred by, or claims asserted against, such Contributor by reason-      of your accepting any such warranty or additional liability.--   END OF TERMS AND CONDITIONS--   APPENDIX: How to apply the Apache License to your work.--      To apply the Apache License to your work, attach the following-      boilerplate notice, with the fields enclosed by brackets "[]"-      replaced with your own identifying information. (Don't include-      the brackets!)  The text should be enclosed in the appropriate-      comment syntax for the file format. We also recommend that a-      file or class name and description of purpose be included on the-      same "printed page" as the copyright notice for easier-      identification within third-party archives.--   Copyright [yyyy] [name of copyright owner]--   Licensed under the Apache License, Version 2.0 (the "License");-   you may not use this file except in compliance with the License.-   You may obtain a copy of the License at--       http://www.apache.org/licenses/LICENSE-2.0--   Unless required by applicable law or agreed to in writing, software-   distributed under the License is distributed on an "AS IS" BASIS,-   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-   See the License for the specific language governing permissions and-   limitations under the License.
− descriptor/Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMainWithHooks defaultUserHooks
− descriptor/Text/DescriptorProtos.hs
@@ -1,18 +0,0 @@-module Text.DescriptorProtos (protoInfo, fileDescriptorProto) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import Text.DescriptorProtos.FileDescriptorProto (FileDescriptorProto)-import Text.ProtocolBuffers.Reflections (ProtoInfo)-import qualified Text.ProtocolBuffers.WireMessage as P' (wireGet,getFromBS)- -protoInfo :: ProtoInfo-protoInfo-  = P'.read-      "ProtoInfo {protoMod = ProtoName {haskellPrefix = \"Text\", parentModule = \"\", baseName = \"DescriptorProtos\"}, protoFilePath = [\"Text\",\"DescriptorProtos.hs\"], protoSource = \"/Users/chrisk/Documents/projects/haskell/develop/protocol-buffers/descriptor/./descriptor.proto\", extensionKeys = fromList [], messages = [DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FileDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"FileDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"package\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"dependency\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"message_type\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"DescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"enum_type\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 42}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"service\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 50}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"ServiceDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"extension\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 58}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 66}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FileOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"DescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"DescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"field\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"extension\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 50}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"nested_type\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"DescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"enum_type\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"extension_range\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 42}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"ExtensionRange\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 58}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MessageOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"ExtensionRange\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"DescriptorProto\",\"ExtensionRange.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto.ExtensionRange\", baseName = \"start\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto.ExtensionRange\", baseName = \"end\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"FieldDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"number\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"label\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"Label\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"type'\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 40}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"Type\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"type_name\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 50}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"extendee\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"default_value\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 58}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 66}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"EnumDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumDescriptorProto\", baseName = \"value\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumValueDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumValueDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"EnumValueDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumValueDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumValueDescriptorProto\", baseName = \"number\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumValueDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumValueOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"ServiceDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"ServiceDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.ServiceDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.ServiceDescriptorProto\", baseName = \"method\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MethodDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.ServiceDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"ServiceOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MethodDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"MethodDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.MethodDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.MethodDescriptorProto\", baseName = \"input_type\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.MethodDescriptorProto\", baseName = \"output_type\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.MethodDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MethodOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FileOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"FileOptions.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileOptions\", baseName = \"java_package\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileOptions\", baseName = \"java_outer_classname\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 66}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileOptions\", baseName = \"java_multiple_files\"}, fieldNumber = FieldId {getFieldId = 10}, wireTag = WireTag {getWireTag = 80}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Just (Chunk \"false\" Empty), hsDefault = Just (HsDef'Bool False)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileOptions\", baseName = \"optimize_for\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 72}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileOptions\", baseName = \"OptimizeMode\"}), hsRawDefault = Just (Chunk \"CODE_SIZE\" Empty), hsDefault = Just (HsDef'Enum \"CODE_SIZE\")}], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MessageOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"MessageOptions.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.MessageOptions\", baseName = \"message_set_wire_format\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Just (Chunk \"false\" Empty), hsDefault = Just (HsDef'Bool False)}], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"FieldOptions.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldOptions\", baseName = \"ctype\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldOptions\", baseName = \"CType\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldOptions\", baseName = \"experimental_map_key\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 74}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"EnumOptions.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumValueOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"EnumValueOptions.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"ServiceOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"ServiceOptions.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []},DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MethodOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"MethodOptions.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []}], enums = [EnumInfo {enumName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"Type\"}, enumFilePath = [\"Text\",\"DescriptorProtos\",\"FieldDescriptorProto\",\"Type.hs\"], enumValues = [(EnumCode {getEnumCode = 1},\"TYPE_DOUBLE\"),(EnumCode {getEnumCode = 2},\"TYPE_FLOAT\"),(EnumCode {getEnumCode = 3},\"TYPE_INT64\"),(EnumCode {getEnumCode = 4},\"TYPE_UINT64\"),(EnumCode {getEnumCode = 5},\"TYPE_INT32\"),(EnumCode {getEnumCode = 6},\"TYPE_FIXED64\"),(EnumCode {getEnumCode = 7},\"TYPE_FIXED32\"),(EnumCode {getEnumCode = 8},\"TYPE_BOOL\"),(EnumCode {getEnumCode = 9},\"TYPE_STRING\"),(EnumCode {getEnumCode = 10},\"TYPE_GROUP\"),(EnumCode {getEnumCode = 11},\"TYPE_MESSAGE\"),(EnumCode {getEnumCode = 12},\"TYPE_BYTES\"),(EnumCode {getEnumCode = 13},\"TYPE_UINT32\"),(EnumCode {getEnumCode = 14},\"TYPE_ENUM\"),(EnumCode {getEnumCode = 15},\"TYPE_SFIXED32\"),(EnumCode {getEnumCode = 16},\"TYPE_SFIXED64\"),(EnumCode {getEnumCode = 17},\"TYPE_SINT32\"),(EnumCode {getEnumCode = 18},\"TYPE_SINT64\")]},EnumInfo {enumName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"Label\"}, enumFilePath = [\"Text\",\"DescriptorProtos\",\"FieldDescriptorProto\",\"Label.hs\"], enumValues = [(EnumCode {getEnumCode = 1},\"LABEL_OPTIONAL\"),(EnumCode {getEnumCode = 2},\"LABEL_REQUIRED\"),(EnumCode {getEnumCode = 3},\"LABEL_REPEATED\")]},EnumInfo {enumName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileOptions\", baseName = \"OptimizeMode\"}, enumFilePath = [\"Text\",\"DescriptorProtos\",\"FileOptions\",\"OptimizeMode.hs\"], enumValues = [(EnumCode {getEnumCode = 1},\"SPEED\"),(EnumCode {getEnumCode = 2},\"CODE_SIZE\")]},EnumInfo {enumName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldOptions\", baseName = \"CType\"}, enumFilePath = [\"Text\",\"DescriptorProtos\",\"FieldOptions\",\"CType.hs\"], enumValues = [(EnumCode {getEnumCode = 1},\"CORD\"),(EnumCode {getEnumCode = 2},\"STRING_PIECE\")]}], knownKeyMap = fromList []}"- -fileDescriptorProto :: FileDescriptorProto-fileDescriptorProto-  = P'.getFromBS (P'.wireGet 11)-      (P'.pack-         "\235\SYN\n_/Users/chrisk/Documents/projects/haskell/develop/protocol-buffers/descriptor/./descriptor.proto\DC2\SIgoogle.protobuf\"\229\STX\n$DescriptorProtos.FileDescriptorProto\DC2\f\n\EOTname\CAN\SOH \SOH(\t\DC2\SI\n\apackage\CAN\STX \SOH(\t\DC2\DC2\n\ndependency\CAN\ETX \ETX(\t\DC26\n\fmessage_type\CAN\EOT \ETX(\v2 DescriptorProtos.DescriptorProto\DC27\n\tenum_type\CAN\ENQ \ETX(\v2$DescriptorProtos.EnumDescriptorProto\DC28\n\aservice\CAN\ACK \ETX(\v2'DescriptorProtos.ServiceDescriptorProto\DC28\n\textension\CAN\a \ETX(\v2%DescriptorProtos.FieldDescriptorProto\DC2-\n\aoptions\CAN\b \SOH(\v2\FSDescriptorProtos.FileOptions\"\209\ETX\n DescriptorProtos.DescriptorProto\DC2\f\n\EOTname\CAN\SOH \SOH(\t\DC24\n\ENQfield\CAN\STX \ETX(\v2%DescriptorProtos.FieldDescriptorProto\DC28\n\textension\CAN\ACK \ETX(\v2%DescriptorProtos.FieldDescriptorProto\DC25\n\vnested_type\CAN\ETX \ETX(\v2 DescriptorProtos.DescriptorProto\DC27\n\tenum_type\CAN\EOT \ETX(\v2$DescriptorProtos.EnumDescriptorProto\DC2H\n\SIextension_range\CAN\ENQ \ETX(\v2/DescriptorProtos.DescriptorProto.ExtensionRange\DC20\n\aoptions\CAN\a \SOH(\v2\USDescriptorProtos.MessageOptions\SUBK\n/DescriptorProtos.DescriptorProto.ExtensionRange\DC2\r\n\ENQstart\CAN\SOH \SOH(\ENQ\DC2\v\n\ETXend\CAN\STX \SOH(\ENQ\"\210\ENQ\n%DescriptorProtos.FieldDescriptorProto\DC2\f\n\EOTname\CAN\SOH \SOH(\t\DC2\SO\n\ACKnumber\CAN\ETX \SOH(\ENQ\DC2:\n\ENQlabel\CAN\EOT \SOH(\SO2+DescriptorProtos.FieldDescriptorProto.Label\DC29\n\ENQtype'\CAN\ENQ \SOH(\SO2*DescriptorProtos.FieldDescriptorProto.Type\DC2\DC1\n\ttype_name\CAN\ACK \SOH(\t\DC2\DLE\n\bextendee\CAN\STX \SOH(\t\DC2\NAK\n\rdefault_value\CAN\a \SOH(\t\DC2.\n\aoptions\CAN\b \SOH(\v2\GSDescriptorProtos.FieldOptions\"\202\STX\n*DescriptorProtos.FieldDescriptorProto.Type\DC2\SI\n\vTYPE_DOUBLE\DLE\SOH\DC2\SO\n\nTYPE_FLOAT\DLE\STX\DC2\SO\n\nTYPE_INT64\DLE\ETX\DC2\SI\n\vTYPE_UINT64\DLE\EOT\DC2\SO\n\nTYPE_INT32\DLE\ENQ\DC2\DLE\n\fTYPE_FIXED64\DLE\ACK\DC2\DLE\n\fTYPE_FIXED32\DLE\a\DC2\r\n\tTYPE_BOOL\DLE\b\DC2\SI\n\vTYPE_STRING\DLE\t\DC2\SO\n\nTYPE_GROUP\DLE\n\DC2\DLE\n\fTYPE_MESSAGE\DLE\v\DC2\SO\n\nTYPE_BYTES\DLE\f\DC2\SI\n\vTYPE_UINT32\DLE\r\DC2\r\n\tTYPE_ENUM\DLE\SO\DC2\DC1\n\rTYPE_SFIXED32\DLE\SI\DC2\DC1\n\rTYPE_SFIXED64\DLE\DLE\DC2\SI\n\vTYPE_SINT32\DLE\DC1\DC2\SI\n\vTYPE_SINT64\DLE\DC2\"f\n+DescriptorProtos.FieldDescriptorProto.Label\DC2\DC2\n\SOLABEL_OPTIONAL\DLE\SOH\DC2\DC2\n\SOLABEL_REQUIRED\DLE\STX\DC2\DC2\n\SOLABEL_REPEATED\DLE\ETX\"\154\SOH\n$DescriptorProtos.EnumDescriptorProto\DC2\f\n\EOTname\CAN\SOH \SOH(\t\DC28\n\ENQvalue\CAN\STX \ETX(\v2)DescriptorProtos.EnumValueDescriptorProto\DC2-\n\aoptions\CAN\ETX \SOH(\v2\FSDescriptorProtos.EnumOptions\"z\n)DescriptorProtos.EnumValueDescriptorProto\DC2\f\n\EOTname\CAN\SOH \SOH(\t\DC2\SO\n\ACKnumber\CAN\STX \SOH(\ENQ\DC22\n\aoptions\CAN\ETX \SOH(\v2!DescriptorProtos.EnumValueOptions\"\158\SOH\n'DescriptorProtos.ServiceDescriptorProto\DC2\f\n\EOTname\CAN\SOH \SOH(\t\DC26\n\ACKmethod\CAN\STX \ETX(\v2&DescriptorProtos.MethodDescriptorProto\DC20\n\aoptions\CAN\ETX \SOH(\v2\USDescriptorProtos.ServiceOptions\"\140\SOH\n&DescriptorProtos.MethodDescriptorProto\DC2\f\n\EOTname\CAN\SOH \SOH(\t\DC2\DC2\n\ninput_type\CAN\STX \SOH(\t\DC2\DC3\n\voutput_type\CAN\ETX \SOH(\t\DC2/\n\aoptions\CAN\EOT \SOH(\v2\RSDescriptorProtos.MethodOptions\"\130\STX\n\FSDescriptorProtos.FileOptions\DC2\DC4\n\fjava_package\CAN\SOH \SOH(\t\DC2\FS\n\DC4java_outer_classname\CAN\b \SOH(\t\DC2\"\n\DC3java_multiple_files\CAN\n \SOH(\b:\ENQfalse\DC2J\n\foptimize_for\CAN\t \SOH(\SO2)DescriptorProtos.FileOptions.OptimizeMode:\tCODE_SIZE\"C\n)DescriptorProtos.FileOptions.OptimizeMode\DC2\t\n\ENQSPEED\DLE\SOH\DC2\r\n\tCODE_SIZE\DLE\STX\"H\n\USDescriptorProtos.MessageOptions\DC2&\n\ETBmessage_set_wire_format\CAN\SOH \SOH(\b:\ENQfalse\"\175\SOH\n\GSDescriptorProtos.FieldOptions\DC22\n\ENQctype\CAN\SOH \SOH(\SO2#DescriptorProtos.FieldOptions.CType\DC2\FS\n\DC4experimental_map_key\CAN\t \SOH(\t\"?\n#DescriptorProtos.FieldOptions.CType\DC2\b\n\EOTCORD\DLE\SOH\DC2\DLE\n\fSTRING_PIECE\DLE\STX\"\RS\n\FSDescriptorProtos.EnumOptions\"#\n!DescriptorProtos.EnumValueOptions\"!\n\USDescriptorProtos.ServiceOptions\" \n\RSDescriptorProtos.MethodOptionsB)\n\DC3com.google.protobufB\DLEDescriptorProtosH\SOH")
− descriptor/Text/DescriptorProtos/DescriptorProto.hs
@@ -1,88 +0,0 @@-module Text.DescriptorProtos.DescriptorProto (DescriptorProto(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified Text.DescriptorProtos.DescriptorProto.ExtensionRange as DescriptorProtos.DescriptorProto (ExtensionRange)-import qualified Text.DescriptorProtos.EnumDescriptorProto as DescriptorProtos (EnumDescriptorProto)-import qualified Text.DescriptorProtos.FieldDescriptorProto as DescriptorProtos (FieldDescriptorProto)-import qualified Text.DescriptorProtos.MessageOptions as DescriptorProtos (MessageOptions)- -data DescriptorProto = DescriptorProto{name :: P'.Maybe P'.Utf8, field :: P'.Seq DescriptorProtos.FieldDescriptorProto,-                                       extension :: P'.Seq DescriptorProtos.FieldDescriptorProto,-                                       nested_type :: P'.Seq DescriptorProto,-                                       enum_type :: P'.Seq DescriptorProtos.EnumDescriptorProto,-                                       extension_range :: P'.Seq DescriptorProtos.DescriptorProto.ExtensionRange,-                                       options :: P'.Maybe DescriptorProtos.MessageOptions}-                     deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable DescriptorProto where-  mergeEmpty = DescriptorProto P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-  mergeAppend (DescriptorProto x'1 x'2 x'3 x'4 x'5 x'6 x'7) (DescriptorProto y'1 y'2 y'3 y'4 y'5 y'6 y'7)-    = DescriptorProto (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)-        (P'.mergeAppend x'5 y'5)-        (P'.mergeAppend x'6 y'6)-        (P'.mergeAppend x'7 y'7)- -instance P'.Default DescriptorProto where-  defaultValue-    = DescriptorProto (P'.Just P'.defaultValue) P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue-        (P'.Just P'.defaultValue)- -instance P'.Wire DescriptorProto where-  wireSize ft' self'@(DescriptorProto x'1 x'2 x'3 x'4 x'5 x'6 x'7)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size-          = (P'.wireSizeOpt 1 9 x'1 + P'.wireSizeRep 1 11 x'2 + P'.wireSizeRep 1 11 x'3 + P'.wireSizeRep 1 11 x'4 +-               P'.wireSizeRep 1 11 x'5-               + P'.wireSizeRep 1 11 x'6-               + P'.wireSizeOpt 1 11 x'7)-  wirePut ft' self'@(DescriptorProto x'1 x'2 x'3 x'4 x'5 x'6 x'7)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.wirePutOpt 10 9 x'1-              P'.wirePutRep 18 11 x'2-              P'.wirePutRep 26 11 x'4-              P'.wirePutRep 34 11 x'5-              P'.wirePutRep 42 11 x'6-              P'.wirePutRep 50 11 x'3-              P'.wirePutOpt 58 11 x'7-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{name = P'.Just new'Field}) (P'.wireGet 9)-              2 -> P'.fmap (\ new'Field -> old'Self{field = P'.append (field old'Self) new'Field}) (P'.wireGet 11)-              6 -> P'.fmap (\ new'Field -> old'Self{extension = P'.append (extension old'Self) new'Field}) (P'.wireGet 11)-              3 -> P'.fmap (\ new'Field -> old'Self{nested_type = P'.append (nested_type old'Self) new'Field}) (P'.wireGet 11)-              4 -> P'.fmap (\ new'Field -> old'Self{enum_type = P'.append (enum_type old'Self) new'Field}) (P'.wireGet 11)-              5 -> P'.fmap (\ new'Field -> old'Self{extension_range = P'.append (extension_range old'Self) new'Field})-                     (P'.wireGet 11)-              7 -> P'.fmap (\ new'Field -> old'Self{options = P'.mergeAppend (options old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> DescriptorProto) DescriptorProto where-  getVal m' f' = f' m'- -instance P'.GPB DescriptorProto- -instance P'.ReflectDescriptor DescriptorProto where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"DescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"DescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"field\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"extension\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 50}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"nested_type\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"DescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"enum_type\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"extension_range\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 42}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"ExtensionRange\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 58}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MessageOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/DescriptorProto/ExtensionRange.hs
@@ -1,57 +0,0 @@-module Text.DescriptorProtos.DescriptorProto.ExtensionRange (ExtensionRange(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data ExtensionRange = ExtensionRange{start :: P'.Maybe P'.Int32, end :: P'.Maybe P'.Int32}-                    deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable ExtensionRange where-  mergeEmpty = ExtensionRange P'.mergeEmpty P'.mergeEmpty-  mergeAppend (ExtensionRange x'1 x'2) (ExtensionRange y'1 y'2) = ExtensionRange (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)- -instance P'.Default ExtensionRange where-  defaultValue = ExtensionRange (P'.Just P'.defaultValue) (P'.Just P'.defaultValue)- -instance P'.Wire ExtensionRange where-  wireSize ft' self'@(ExtensionRange x'1 x'2)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 5 x'1 + P'.wireSizeOpt 1 5 x'2)-  wirePut ft' self'@(ExtensionRange x'1 x'2)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.wirePutOpt 8 5 x'1-              P'.wirePutOpt 16 5 x'2-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{start = P'.Just new'Field}) (P'.wireGet 5)-              2 -> P'.fmap (\ new'Field -> old'Self{end = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> ExtensionRange) ExtensionRange where-  getVal m' f' = f' m'- -instance P'.GPB ExtensionRange- -instance P'.ReflectDescriptor ExtensionRange where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto\", baseName = \"ExtensionRange\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"DescriptorProto\",\"ExtensionRange.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto.ExtensionRange\", baseName = \"start\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.DescriptorProto.ExtensionRange\", baseName = \"end\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/EnumDescriptorProto.hs
@@ -1,64 +0,0 @@-module Text.DescriptorProtos.EnumDescriptorProto (EnumDescriptorProto(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified Text.DescriptorProtos.EnumOptions as DescriptorProtos (EnumOptions)-import qualified Text.DescriptorProtos.EnumValueDescriptorProto as DescriptorProtos (EnumValueDescriptorProto)- -data EnumDescriptorProto = EnumDescriptorProto{name :: P'.Maybe P'.Utf8, value :: P'.Seq DescriptorProtos.EnumValueDescriptorProto,-                                               options :: P'.Maybe DescriptorProtos.EnumOptions}-                         deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable EnumDescriptorProto where-  mergeEmpty = EnumDescriptorProto P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-  mergeAppend (EnumDescriptorProto x'1 x'2 x'3) (EnumDescriptorProto y'1 y'2 y'3)-    = EnumDescriptorProto (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3)- -instance P'.Default EnumDescriptorProto where-  defaultValue = EnumDescriptorProto (P'.Just P'.defaultValue) P'.defaultValue (P'.Just P'.defaultValue)- -instance P'.Wire EnumDescriptorProto where-  wireSize ft' self'@(EnumDescriptorProto x'1 x'2 x'3)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 9 x'1 + P'.wireSizeRep 1 11 x'2 + P'.wireSizeOpt 1 11 x'3)-  wirePut ft' self'@(EnumDescriptorProto x'1 x'2 x'3)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.wirePutOpt 10 9 x'1-              P'.wirePutRep 18 11 x'2-              P'.wirePutOpt 26 11 x'3-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{name = P'.Just new'Field}) (P'.wireGet 9)-              2 -> P'.fmap (\ new'Field -> old'Self{value = P'.append (value old'Self) new'Field}) (P'.wireGet 11)-              3 -> P'.fmap (\ new'Field -> old'Self{options = P'.mergeAppend (options old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> EnumDescriptorProto) EnumDescriptorProto where-  getVal m' f' = f' m'- -instance P'.GPB EnumDescriptorProto- -instance P'.ReflectDescriptor EnumDescriptorProto where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"EnumDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumDescriptorProto\", baseName = \"value\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumValueDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/EnumOptions.hs
@@ -1,54 +0,0 @@-module Text.DescriptorProtos.EnumOptions (EnumOptions(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data EnumOptions = EnumOptions{}-                 deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable EnumOptions where-  mergeEmpty = EnumOptions-  mergeAppend (EnumOptions) (EnumOptions) = EnumOptions- -instance P'.Default EnumOptions where-  defaultValue = EnumOptions- -instance P'.Wire EnumOptions where-  wireSize ft' self'@(EnumOptions)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = 0-  wirePut ft' self'@(EnumOptions)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.return ()-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> EnumOptions) EnumOptions where-  getVal m' f' = f' m'- -instance P'.GPB EnumOptions- -instance P'.ReflectDescriptor EnumOptions where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"EnumOptions.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/EnumValueDescriptorProto.hs
@@ -1,63 +0,0 @@-module Text.DescriptorProtos.EnumValueDescriptorProto (EnumValueDescriptorProto(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified Text.DescriptorProtos.EnumValueOptions as DescriptorProtos (EnumValueOptions)- -data EnumValueDescriptorProto = EnumValueDescriptorProto{name :: P'.Maybe P'.Utf8, number :: P'.Maybe P'.Int32,-                                                         options :: P'.Maybe DescriptorProtos.EnumValueOptions}-                              deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable EnumValueDescriptorProto where-  mergeEmpty = EnumValueDescriptorProto P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-  mergeAppend (EnumValueDescriptorProto x'1 x'2 x'3) (EnumValueDescriptorProto y'1 y'2 y'3)-    = EnumValueDescriptorProto (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3)- -instance P'.Default EnumValueDescriptorProto where-  defaultValue = EnumValueDescriptorProto (P'.Just P'.defaultValue) (P'.Just P'.defaultValue) (P'.Just P'.defaultValue)- -instance P'.Wire EnumValueDescriptorProto where-  wireSize ft' self'@(EnumValueDescriptorProto x'1 x'2 x'3)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 9 x'1 + P'.wireSizeOpt 1 5 x'2 + P'.wireSizeOpt 1 11 x'3)-  wirePut ft' self'@(EnumValueDescriptorProto x'1 x'2 x'3)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.wirePutOpt 10 9 x'1-              P'.wirePutOpt 16 5 x'2-              P'.wirePutOpt 26 11 x'3-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{name = P'.Just new'Field}) (P'.wireGet 9)-              2 -> P'.fmap (\ new'Field -> old'Self{number = P'.Just new'Field}) (P'.wireGet 5)-              3 -> P'.fmap (\ new'Field -> old'Self{options = P'.mergeAppend (options old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> EnumValueDescriptorProto) EnumValueDescriptorProto where-  getVal m' f' = f' m'- -instance P'.GPB EnumValueDescriptorProto- -instance P'.ReflectDescriptor EnumValueDescriptorProto where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumValueDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"EnumValueDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumValueDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumValueDescriptorProto\", baseName = \"number\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.EnumValueDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumValueOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/EnumValueOptions.hs
@@ -1,54 +0,0 @@-module Text.DescriptorProtos.EnumValueOptions (EnumValueOptions(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data EnumValueOptions = EnumValueOptions{}-                      deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable EnumValueOptions where-  mergeEmpty = EnumValueOptions-  mergeAppend (EnumValueOptions) (EnumValueOptions) = EnumValueOptions- -instance P'.Default EnumValueOptions where-  defaultValue = EnumValueOptions- -instance P'.Wire EnumValueOptions where-  wireSize ft' self'@(EnumValueOptions)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = 0-  wirePut ft' self'@(EnumValueOptions)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.return ()-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> EnumValueOptions) EnumValueOptions where-  getVal m' f' = f' m'- -instance P'.GPB EnumValueOptions- -instance P'.ReflectDescriptor EnumValueOptions where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumValueOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"EnumValueOptions.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/FieldDescriptorProto.hs
@@ -1,95 +0,0 @@-module Text.DescriptorProtos.FieldDescriptorProto (FieldDescriptorProto(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified Text.DescriptorProtos.FieldDescriptorProto.Label as DescriptorProtos.FieldDescriptorProto (Label)-import qualified Text.DescriptorProtos.FieldDescriptorProto.Type as DescriptorProtos.FieldDescriptorProto (Type)-import qualified Text.DescriptorProtos.FieldOptions as DescriptorProtos (FieldOptions)- -data FieldDescriptorProto = FieldDescriptorProto{name :: P'.Maybe P'.Utf8, number :: P'.Maybe P'.Int32,-                                                 label :: P'.Maybe DescriptorProtos.FieldDescriptorProto.Label,-                                                 type' :: P'.Maybe DescriptorProtos.FieldDescriptorProto.Type,-                                                 type_name :: P'.Maybe P'.Utf8, extendee :: P'.Maybe P'.Utf8,-                                                 default_value :: P'.Maybe P'.Utf8,-                                                 options :: P'.Maybe DescriptorProtos.FieldOptions}-                          deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable FieldDescriptorProto where-  mergeEmpty-    = FieldDescriptorProto P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-        P'.mergeEmpty-  mergeAppend (FieldDescriptorProto x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8) (FieldDescriptorProto y'1 y'2 y'3 y'4 y'5 y'6 y'7 y'8)-    = FieldDescriptorProto (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)-        (P'.mergeAppend x'5 y'5)-        (P'.mergeAppend x'6 y'6)-        (P'.mergeAppend x'7 y'7)-        (P'.mergeAppend x'8 y'8)- -instance P'.Default FieldDescriptorProto where-  defaultValue-    = FieldDescriptorProto (P'.Just P'.defaultValue) (P'.Just P'.defaultValue) (P'.Just P'.defaultValue) (P'.Just P'.defaultValue)-        (P'.Just P'.defaultValue)-        (P'.Just P'.defaultValue)-        (P'.Just P'.defaultValue)-        (P'.Just P'.defaultValue)- -instance P'.Wire FieldDescriptorProto where-  wireSize ft' self'@(FieldDescriptorProto x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size-          = (P'.wireSizeOpt 1 9 x'1 + P'.wireSizeOpt 1 5 x'2 + P'.wireSizeOpt 1 14 x'3 + P'.wireSizeOpt 1 14 x'4 +-               P'.wireSizeOpt 1 9 x'5-               + P'.wireSizeOpt 1 9 x'6-               + P'.wireSizeOpt 1 9 x'7-               + P'.wireSizeOpt 1 11 x'8)-  wirePut ft' self'@(FieldDescriptorProto x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.wirePutOpt 10 9 x'1-              P'.wirePutOpt 18 9 x'6-              P'.wirePutOpt 24 5 x'2-              P'.wirePutOpt 32 14 x'3-              P'.wirePutOpt 40 14 x'4-              P'.wirePutOpt 50 9 x'5-              P'.wirePutOpt 58 9 x'7-              P'.wirePutOpt 66 11 x'8-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{name = P'.Just new'Field}) (P'.wireGet 9)-              3 -> P'.fmap (\ new'Field -> old'Self{number = P'.Just new'Field}) (P'.wireGet 5)-              4 -> P'.fmap (\ new'Field -> old'Self{label = P'.Just new'Field}) (P'.wireGet 14)-              5 -> P'.fmap (\ new'Field -> old'Self{type' = P'.Just new'Field}) (P'.wireGet 14)-              6 -> P'.fmap (\ new'Field -> old'Self{type_name = P'.Just new'Field}) (P'.wireGet 9)-              2 -> P'.fmap (\ new'Field -> old'Self{extendee = P'.Just new'Field}) (P'.wireGet 9)-              7 -> P'.fmap (\ new'Field -> old'Self{default_value = P'.Just new'Field}) (P'.wireGet 9)-              8 -> P'.fmap (\ new'Field -> old'Self{options = P'.mergeAppend (options old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> FieldDescriptorProto) FieldDescriptorProto where-  getVal m' f' = f' m'- -instance P'.GPB FieldDescriptorProto- -instance P'.ReflectDescriptor FieldDescriptorProto where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"FieldDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"number\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"label\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"Label\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"type'\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 40}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"Type\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"type_name\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 50}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"extendee\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"default_value\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 58}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 66}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/FieldDescriptorProto/Label.hs
@@ -1,48 +0,0 @@-module Text.DescriptorProtos.FieldDescriptorProto.Label (Label(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data Label = LABEL_OPTIONAL-           | LABEL_REQUIRED-           | LABEL_REPEATED-           deriving (P'.Read, P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable Label- -instance P'.Bounded Label where-  minBound = LABEL_OPTIONAL-  maxBound = LABEL_REPEATED- -instance P'.Default Label where-  defaultValue = LABEL_OPTIONAL- -instance P'.Enum Label where-  fromEnum (LABEL_OPTIONAL) = 1-  fromEnum (LABEL_REQUIRED) = 2-  fromEnum (LABEL_REPEATED) = 3-  toEnum 1 = LABEL_OPTIONAL-  toEnum 2 = LABEL_REQUIRED-  toEnum 3 = LABEL_REPEATED-  succ (LABEL_OPTIONAL) = LABEL_REQUIRED-  succ (LABEL_REQUIRED) = LABEL_REPEATED-  pred (LABEL_REQUIRED) = LABEL_OPTIONAL-  pred (LABEL_REPEATED) = LABEL_REQUIRED- -instance P'.Wire Label where-  wireSize 14 enum = P'.wireSize 14 (P'.fromEnum enum)-  wirePut 14 enum = P'.wirePut 14 (P'.fromEnum enum)-  wireGet 14 = P'.fmap P'.toEnum (P'.wireGet 14)- -instance P'.GPB Label- -instance P'.MessageAPI msg' (msg' -> Label) Label where-  getVal m' f' = f' m'- -instance P'.ReflectEnum Label where-  reflectEnum-    = [(1, "LABEL_OPTIONAL", LABEL_OPTIONAL), (2, "LABEL_REQUIRED", LABEL_REQUIRED), (3, "LABEL_REPEATED", LABEL_REPEATED)]-  reflectEnumInfo _-    = P'.EnumInfo (P'.ProtoName "Text" "DescriptorProtos.FieldDescriptorProto" "Label")-        ["Text", "DescriptorProtos", "FieldDescriptorProto", "Label.hs"]-        [(1, "LABEL_OPTIONAL"), (2, "LABEL_REQUIRED"), (3, "LABEL_REPEATED")]
− descriptor/Text/DescriptorProtos/FieldDescriptorProto/Type.hs
@@ -1,131 +0,0 @@-module Text.DescriptorProtos.FieldDescriptorProto.Type (Type(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data Type = TYPE_DOUBLE-          | TYPE_FLOAT-          | TYPE_INT64-          | TYPE_UINT64-          | TYPE_INT32-          | TYPE_FIXED64-          | TYPE_FIXED32-          | TYPE_BOOL-          | TYPE_STRING-          | TYPE_GROUP-          | TYPE_MESSAGE-          | TYPE_BYTES-          | TYPE_UINT32-          | TYPE_ENUM-          | TYPE_SFIXED32-          | TYPE_SFIXED64-          | TYPE_SINT32-          | TYPE_SINT64-          deriving (P'.Read, P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable Type- -instance P'.Bounded Type where-  minBound = TYPE_DOUBLE-  maxBound = TYPE_SINT64- -instance P'.Default Type where-  defaultValue = TYPE_DOUBLE- -instance P'.Enum Type where-  fromEnum (TYPE_DOUBLE) = 1-  fromEnum (TYPE_FLOAT) = 2-  fromEnum (TYPE_INT64) = 3-  fromEnum (TYPE_UINT64) = 4-  fromEnum (TYPE_INT32) = 5-  fromEnum (TYPE_FIXED64) = 6-  fromEnum (TYPE_FIXED32) = 7-  fromEnum (TYPE_BOOL) = 8-  fromEnum (TYPE_STRING) = 9-  fromEnum (TYPE_GROUP) = 10-  fromEnum (TYPE_MESSAGE) = 11-  fromEnum (TYPE_BYTES) = 12-  fromEnum (TYPE_UINT32) = 13-  fromEnum (TYPE_ENUM) = 14-  fromEnum (TYPE_SFIXED32) = 15-  fromEnum (TYPE_SFIXED64) = 16-  fromEnum (TYPE_SINT32) = 17-  fromEnum (TYPE_SINT64) = 18-  toEnum 1 = TYPE_DOUBLE-  toEnum 2 = TYPE_FLOAT-  toEnum 3 = TYPE_INT64-  toEnum 4 = TYPE_UINT64-  toEnum 5 = TYPE_INT32-  toEnum 6 = TYPE_FIXED64-  toEnum 7 = TYPE_FIXED32-  toEnum 8 = TYPE_BOOL-  toEnum 9 = TYPE_STRING-  toEnum 10 = TYPE_GROUP-  toEnum 11 = TYPE_MESSAGE-  toEnum 12 = TYPE_BYTES-  toEnum 13 = TYPE_UINT32-  toEnum 14 = TYPE_ENUM-  toEnum 15 = TYPE_SFIXED32-  toEnum 16 = TYPE_SFIXED64-  toEnum 17 = TYPE_SINT32-  toEnum 18 = TYPE_SINT64-  succ (TYPE_DOUBLE) = TYPE_FLOAT-  succ (TYPE_FLOAT) = TYPE_INT64-  succ (TYPE_INT64) = TYPE_UINT64-  succ (TYPE_UINT64) = TYPE_INT32-  succ (TYPE_INT32) = TYPE_FIXED64-  succ (TYPE_FIXED64) = TYPE_FIXED32-  succ (TYPE_FIXED32) = TYPE_BOOL-  succ (TYPE_BOOL) = TYPE_STRING-  succ (TYPE_STRING) = TYPE_GROUP-  succ (TYPE_GROUP) = TYPE_MESSAGE-  succ (TYPE_MESSAGE) = TYPE_BYTES-  succ (TYPE_BYTES) = TYPE_UINT32-  succ (TYPE_UINT32) = TYPE_ENUM-  succ (TYPE_ENUM) = TYPE_SFIXED32-  succ (TYPE_SFIXED32) = TYPE_SFIXED64-  succ (TYPE_SFIXED64) = TYPE_SINT32-  succ (TYPE_SINT32) = TYPE_SINT64-  pred (TYPE_FLOAT) = TYPE_DOUBLE-  pred (TYPE_INT64) = TYPE_FLOAT-  pred (TYPE_UINT64) = TYPE_INT64-  pred (TYPE_INT32) = TYPE_UINT64-  pred (TYPE_FIXED64) = TYPE_INT32-  pred (TYPE_FIXED32) = TYPE_FIXED64-  pred (TYPE_BOOL) = TYPE_FIXED32-  pred (TYPE_STRING) = TYPE_BOOL-  pred (TYPE_GROUP) = TYPE_STRING-  pred (TYPE_MESSAGE) = TYPE_GROUP-  pred (TYPE_BYTES) = TYPE_MESSAGE-  pred (TYPE_UINT32) = TYPE_BYTES-  pred (TYPE_ENUM) = TYPE_UINT32-  pred (TYPE_SFIXED32) = TYPE_ENUM-  pred (TYPE_SFIXED64) = TYPE_SFIXED32-  pred (TYPE_SINT32) = TYPE_SFIXED64-  pred (TYPE_SINT64) = TYPE_SINT32- -instance P'.Wire Type where-  wireSize 14 enum = P'.wireSize 14 (P'.fromEnum enum)-  wirePut 14 enum = P'.wirePut 14 (P'.fromEnum enum)-  wireGet 14 = P'.fmap P'.toEnum (P'.wireGet 14)- -instance P'.GPB Type- -instance P'.MessageAPI msg' (msg' -> Type) Type where-  getVal m' f' = f' m'- -instance P'.ReflectEnum Type where-  reflectEnum-    = [(1, "TYPE_DOUBLE", TYPE_DOUBLE), (2, "TYPE_FLOAT", TYPE_FLOAT), (3, "TYPE_INT64", TYPE_INT64),-       (4, "TYPE_UINT64", TYPE_UINT64), (5, "TYPE_INT32", TYPE_INT32), (6, "TYPE_FIXED64", TYPE_FIXED64),-       (7, "TYPE_FIXED32", TYPE_FIXED32), (8, "TYPE_BOOL", TYPE_BOOL), (9, "TYPE_STRING", TYPE_STRING),-       (10, "TYPE_GROUP", TYPE_GROUP), (11, "TYPE_MESSAGE", TYPE_MESSAGE), (12, "TYPE_BYTES", TYPE_BYTES),-       (13, "TYPE_UINT32", TYPE_UINT32), (14, "TYPE_ENUM", TYPE_ENUM), (15, "TYPE_SFIXED32", TYPE_SFIXED32),-       (16, "TYPE_SFIXED64", TYPE_SFIXED64), (17, "TYPE_SINT32", TYPE_SINT32), (18, "TYPE_SINT64", TYPE_SINT64)]-  reflectEnumInfo _-    = P'.EnumInfo (P'.ProtoName "Text" "DescriptorProtos.FieldDescriptorProto" "Type")-        ["Text", "DescriptorProtos", "FieldDescriptorProto", "Type.hs"]-        [(1, "TYPE_DOUBLE"), (2, "TYPE_FLOAT"), (3, "TYPE_INT64"), (4, "TYPE_UINT64"), (5, "TYPE_INT32"), (6, "TYPE_FIXED64"),-         (7, "TYPE_FIXED32"), (8, "TYPE_BOOL"), (9, "TYPE_STRING"), (10, "TYPE_GROUP"), (11, "TYPE_MESSAGE"), (12, "TYPE_BYTES"),-         (13, "TYPE_UINT32"), (14, "TYPE_ENUM"), (15, "TYPE_SFIXED32"), (16, "TYPE_SFIXED64"), (17, "TYPE_SINT32"),-         (18, "TYPE_SINT64")]
− descriptor/Text/DescriptorProtos/FieldOptions.hs
@@ -1,58 +0,0 @@-module Text.DescriptorProtos.FieldOptions (FieldOptions(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified Text.DescriptorProtos.FieldOptions.CType as DescriptorProtos.FieldOptions (CType)- -data FieldOptions = FieldOptions{ctype :: P'.Maybe DescriptorProtos.FieldOptions.CType, experimental_map_key :: P'.Maybe P'.Utf8}-                  deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable FieldOptions where-  mergeEmpty = FieldOptions P'.mergeEmpty P'.mergeEmpty-  mergeAppend (FieldOptions x'1 x'2) (FieldOptions y'1 y'2) = FieldOptions (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)- -instance P'.Default FieldOptions where-  defaultValue = FieldOptions (P'.Just P'.defaultValue) (P'.Just P'.defaultValue)- -instance P'.Wire FieldOptions where-  wireSize ft' self'@(FieldOptions x'1 x'2)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 14 x'1 + P'.wireSizeOpt 1 9 x'2)-  wirePut ft' self'@(FieldOptions x'1 x'2)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.wirePutOpt 8 14 x'1-              P'.wirePutOpt 74 9 x'2-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{ctype = P'.Just new'Field}) (P'.wireGet 14)-              9 -> P'.fmap (\ new'Field -> old'Self{experimental_map_key = P'.Just new'Field}) (P'.wireGet 9)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> FieldOptions) FieldOptions where-  getVal m' f' = f' m'- -instance P'.GPB FieldOptions- -instance P'.ReflectDescriptor FieldOptions where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"FieldOptions.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldOptions\", baseName = \"ctype\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldOptions\", baseName = \"CType\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FieldOptions\", baseName = \"experimental_map_key\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 74}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/FieldOptions/CType.hs
@@ -1,42 +0,0 @@-module Text.DescriptorProtos.FieldOptions.CType (CType(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data CType = CORD-           | STRING_PIECE-           deriving (P'.Read, P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable CType- -instance P'.Bounded CType where-  minBound = CORD-  maxBound = STRING_PIECE- -instance P'.Default CType where-  defaultValue = CORD- -instance P'.Enum CType where-  fromEnum (CORD) = 1-  fromEnum (STRING_PIECE) = 2-  toEnum 1 = CORD-  toEnum 2 = STRING_PIECE-  succ (CORD) = STRING_PIECE-  pred (STRING_PIECE) = CORD- -instance P'.Wire CType where-  wireSize 14 enum = P'.wireSize 14 (P'.fromEnum enum)-  wirePut 14 enum = P'.wirePut 14 (P'.fromEnum enum)-  wireGet 14 = P'.fmap P'.toEnum (P'.wireGet 14)- -instance P'.GPB CType- -instance P'.MessageAPI msg' (msg' -> CType) CType where-  getVal m' f' = f' m'- -instance P'.ReflectEnum CType where-  reflectEnum = [(1, "CORD", CORD), (2, "STRING_PIECE", STRING_PIECE)]-  reflectEnumInfo _-    = P'.EnumInfo (P'.ProtoName "Text" "DescriptorProtos.FieldOptions" "CType")-        ["Text", "DescriptorProtos", "FieldOptions", "CType.hs"]-        [(1, "CORD"), (2, "STRING_PIECE")]
− descriptor/Text/DescriptorProtos/FileDescriptorProto.hs
@@ -1,96 +0,0 @@-module Text.DescriptorProtos.FileDescriptorProto (FileDescriptorProto(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified Text.DescriptorProtos.DescriptorProto as DescriptorProtos (DescriptorProto)-import qualified Text.DescriptorProtos.EnumDescriptorProto as DescriptorProtos (EnumDescriptorProto)-import qualified Text.DescriptorProtos.FieldDescriptorProto as DescriptorProtos (FieldDescriptorProto)-import qualified Text.DescriptorProtos.FileOptions as DescriptorProtos (FileOptions)-import qualified Text.DescriptorProtos.ServiceDescriptorProto as DescriptorProtos (ServiceDescriptorProto)- -data FileDescriptorProto = FileDescriptorProto{name :: P'.Maybe P'.Utf8, package :: P'.Maybe P'.Utf8, dependency :: P'.Seq P'.Utf8,-                                               message_type :: P'.Seq DescriptorProtos.DescriptorProto,-                                               enum_type :: P'.Seq DescriptorProtos.EnumDescriptorProto,-                                               service :: P'.Seq DescriptorProtos.ServiceDescriptorProto,-                                               extension :: P'.Seq DescriptorProtos.FieldDescriptorProto,-                                               options :: P'.Maybe DescriptorProtos.FileOptions}-                         deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable FileDescriptorProto where-  mergeEmpty-    = FileDescriptorProto P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-        P'.mergeEmpty-  mergeAppend (FileDescriptorProto x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8) (FileDescriptorProto y'1 y'2 y'3 y'4 y'5 y'6 y'7 y'8)-    = FileDescriptorProto (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)-        (P'.mergeAppend x'5 y'5)-        (P'.mergeAppend x'6 y'6)-        (P'.mergeAppend x'7 y'7)-        (P'.mergeAppend x'8 y'8)- -instance P'.Default FileDescriptorProto where-  defaultValue-    = FileDescriptorProto (P'.Just P'.defaultValue) (P'.Just P'.defaultValue) P'.defaultValue P'.defaultValue P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        (P'.Just P'.defaultValue)- -instance P'.Wire FileDescriptorProto where-  wireSize ft' self'@(FileDescriptorProto x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size-          = (P'.wireSizeOpt 1 9 x'1 + P'.wireSizeOpt 1 9 x'2 + P'.wireSizeRep 1 9 x'3 + P'.wireSizeRep 1 11 x'4 +-               P'.wireSizeRep 1 11 x'5-               + P'.wireSizeRep 1 11 x'6-               + P'.wireSizeRep 1 11 x'7-               + P'.wireSizeOpt 1 11 x'8)-  wirePut ft' self'@(FileDescriptorProto x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.wirePutOpt 10 9 x'1-              P'.wirePutOpt 18 9 x'2-              P'.wirePutRep 26 9 x'3-              P'.wirePutRep 34 11 x'4-              P'.wirePutRep 42 11 x'5-              P'.wirePutRep 50 11 x'6-              P'.wirePutRep 58 11 x'7-              P'.wirePutOpt 66 11 x'8-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{name = P'.Just new'Field}) (P'.wireGet 9)-              2 -> P'.fmap (\ new'Field -> old'Self{package = P'.Just new'Field}) (P'.wireGet 9)-              3 -> P'.fmap (\ new'Field -> old'Self{dependency = P'.append (dependency old'Self) new'Field}) (P'.wireGet 9)-              4 -> P'.fmap (\ new'Field -> old'Self{message_type = P'.append (message_type old'Self) new'Field}) (P'.wireGet 11)-              5 -> P'.fmap (\ new'Field -> old'Self{enum_type = P'.append (enum_type old'Self) new'Field}) (P'.wireGet 11)-              6 -> P'.fmap (\ new'Field -> old'Self{service = P'.append (service old'Self) new'Field}) (P'.wireGet 11)-              7 -> P'.fmap (\ new'Field -> old'Self{extension = P'.append (extension old'Self) new'Field}) (P'.wireGet 11)-              8 -> P'.fmap (\ new'Field -> old'Self{options = P'.mergeAppend (options old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> FileDescriptorProto) FileDescriptorProto where-  getVal m' f' = f' m'- -instance P'.GPB FileDescriptorProto- -instance P'.ReflectDescriptor FileDescriptorProto where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FileDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"FileDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"package\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"dependency\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"message_type\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"DescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"enum_type\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 42}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"EnumDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"service\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 50}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"ServiceDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"extension\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 58}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FieldDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 66}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FileOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/FileOptions.hs
@@ -1,65 +0,0 @@-module Text.DescriptorProtos.FileOptions (FileOptions(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified Text.DescriptorProtos.FileOptions.OptimizeMode as DescriptorProtos.FileOptions (OptimizeMode)- -data FileOptions = FileOptions{java_package :: P'.Maybe P'.Utf8, java_outer_classname :: P'.Maybe P'.Utf8,-                               java_multiple_files :: P'.Maybe P'.Bool,-                               optimize_for :: P'.Maybe DescriptorProtos.FileOptions.OptimizeMode}-                 deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable FileOptions where-  mergeEmpty = FileOptions P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-  mergeAppend (FileOptions x'1 x'2 x'3 x'4) (FileOptions y'1 y'2 y'3 y'4)-    = FileOptions (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)- -instance P'.Default FileOptions where-  defaultValue = FileOptions (P'.Just P'.defaultValue) (P'.Just P'.defaultValue) (P'.Just P'.False) (P'.Just (P'.read "CODE_SIZE"))- -instance P'.Wire FileOptions where-  wireSize ft' self'@(FileOptions x'1 x'2 x'3 x'4)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 9 x'1 + P'.wireSizeOpt 1 9 x'2 + P'.wireSizeOpt 1 8 x'3 + P'.wireSizeOpt 1 14 x'4)-  wirePut ft' self'@(FileOptions x'1 x'2 x'3 x'4)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.wirePutOpt 10 9 x'1-              P'.wirePutOpt 66 9 x'2-              P'.wirePutOpt 72 14 x'4-              P'.wirePutOpt 80 8 x'3-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{java_package = P'.Just new'Field}) (P'.wireGet 9)-              8 -> P'.fmap (\ new'Field -> old'Self{java_outer_classname = P'.Just new'Field}) (P'.wireGet 9)-              10 -> P'.fmap (\ new'Field -> old'Self{java_multiple_files = P'.Just new'Field}) (P'.wireGet 8)-              9 -> P'.fmap (\ new'Field -> old'Self{optimize_for = P'.Just new'Field}) (P'.wireGet 14)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> FileOptions) FileOptions where-  getVal m' f' = f' m'- -instance P'.GPB FileOptions- -instance P'.ReflectDescriptor FileOptions where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"FileOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"FileOptions.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileOptions\", baseName = \"java_package\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileOptions\", baseName = \"java_outer_classname\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 66}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileOptions\", baseName = \"java_multiple_files\"}, fieldNumber = FieldId {getFieldId = 10}, wireTag = WireTag {getWireTag = 80}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Just (Chunk \"false\" Empty), hsDefault = Just (HsDef'Bool False)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileOptions\", baseName = \"optimize_for\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 72}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.FileOptions\", baseName = \"OptimizeMode\"}), hsRawDefault = Just (Chunk \"CODE_SIZE\" Empty), hsDefault = Just (HsDef'Enum \"CODE_SIZE\")}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/FileOptions/OptimizeMode.hs
@@ -1,42 +0,0 @@-module Text.DescriptorProtos.FileOptions.OptimizeMode (OptimizeMode(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data OptimizeMode = SPEED-                  | CODE_SIZE-                  deriving (P'.Read, P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable OptimizeMode- -instance P'.Bounded OptimizeMode where-  minBound = SPEED-  maxBound = CODE_SIZE- -instance P'.Default OptimizeMode where-  defaultValue = SPEED- -instance P'.Enum OptimizeMode where-  fromEnum (SPEED) = 1-  fromEnum (CODE_SIZE) = 2-  toEnum 1 = SPEED-  toEnum 2 = CODE_SIZE-  succ (SPEED) = CODE_SIZE-  pred (CODE_SIZE) = SPEED- -instance P'.Wire OptimizeMode where-  wireSize 14 enum = P'.wireSize 14 (P'.fromEnum enum)-  wirePut 14 enum = P'.wirePut 14 (P'.fromEnum enum)-  wireGet 14 = P'.fmap P'.toEnum (P'.wireGet 14)- -instance P'.GPB OptimizeMode- -instance P'.MessageAPI msg' (msg' -> OptimizeMode) OptimizeMode where-  getVal m' f' = f' m'- -instance P'.ReflectEnum OptimizeMode where-  reflectEnum = [(1, "SPEED", SPEED), (2, "CODE_SIZE", CODE_SIZE)]-  reflectEnumInfo _-    = P'.EnumInfo (P'.ProtoName "Text" "DescriptorProtos.FileOptions" "OptimizeMode")-        ["Text", "DescriptorProtos", "FileOptions", "OptimizeMode.hs"]-        [(1, "SPEED"), (2, "CODE_SIZE")]
− descriptor/Text/DescriptorProtos/MessageOptions.hs
@@ -1,55 +0,0 @@-module Text.DescriptorProtos.MessageOptions (MessageOptions(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data MessageOptions = MessageOptions{message_set_wire_format :: P'.Maybe P'.Bool}-                    deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable MessageOptions where-  mergeEmpty = MessageOptions P'.mergeEmpty-  mergeAppend (MessageOptions x'1) (MessageOptions y'1) = MessageOptions (P'.mergeAppend x'1 y'1)- -instance P'.Default MessageOptions where-  defaultValue = MessageOptions (P'.Just P'.False)- -instance P'.Wire MessageOptions where-  wireSize ft' self'@(MessageOptions x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 8 x'1)-  wirePut ft' self'@(MessageOptions x'1)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.wirePutOpt 8 8 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{message_set_wire_format = P'.Just new'Field}) (P'.wireGet 8)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> MessageOptions) MessageOptions where-  getVal m' f' = f' m'- -instance P'.GPB MessageOptions- -instance P'.ReflectDescriptor MessageOptions where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MessageOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"MessageOptions.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.MessageOptions\", baseName = \"message_set_wire_format\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Just (Chunk \"false\" Empty), hsDefault = Just (HsDef'Bool False)}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/MethodDescriptorProto.hs
@@ -1,67 +0,0 @@-module Text.DescriptorProtos.MethodDescriptorProto (MethodDescriptorProto(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified Text.DescriptorProtos.MethodOptions as DescriptorProtos (MethodOptions)- -data MethodDescriptorProto = MethodDescriptorProto{name :: P'.Maybe P'.Utf8, input_type :: P'.Maybe P'.Utf8,-                                                   output_type :: P'.Maybe P'.Utf8,-                                                   options :: P'.Maybe DescriptorProtos.MethodOptions}-                           deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable MethodDescriptorProto where-  mergeEmpty = MethodDescriptorProto P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-  mergeAppend (MethodDescriptorProto x'1 x'2 x'3 x'4) (MethodDescriptorProto y'1 y'2 y'3 y'4)-    = MethodDescriptorProto (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)- -instance P'.Default MethodDescriptorProto where-  defaultValue-    = MethodDescriptorProto (P'.Just P'.defaultValue) (P'.Just P'.defaultValue) (P'.Just P'.defaultValue) (P'.Just P'.defaultValue)- -instance P'.Wire MethodDescriptorProto where-  wireSize ft' self'@(MethodDescriptorProto x'1 x'2 x'3 x'4)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 9 x'1 + P'.wireSizeOpt 1 9 x'2 + P'.wireSizeOpt 1 9 x'3 + P'.wireSizeOpt 1 11 x'4)-  wirePut ft' self'@(MethodDescriptorProto x'1 x'2 x'3 x'4)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.wirePutOpt 10 9 x'1-              P'.wirePutOpt 18 9 x'2-              P'.wirePutOpt 26 9 x'3-              P'.wirePutOpt 34 11 x'4-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{name = P'.Just new'Field}) (P'.wireGet 9)-              2 -> P'.fmap (\ new'Field -> old'Self{input_type = P'.Just new'Field}) (P'.wireGet 9)-              3 -> P'.fmap (\ new'Field -> old'Self{output_type = P'.Just new'Field}) (P'.wireGet 9)-              4 -> P'.fmap (\ new'Field -> old'Self{options = P'.mergeAppend (options old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> MethodDescriptorProto) MethodDescriptorProto where-  getVal m' f' = f' m'- -instance P'.GPB MethodDescriptorProto- -instance P'.ReflectDescriptor MethodDescriptorProto where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MethodDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"MethodDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.MethodDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.MethodDescriptorProto\", baseName = \"input_type\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.MethodDescriptorProto\", baseName = \"output_type\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.MethodDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MethodOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/MethodOptions.hs
@@ -1,54 +0,0 @@-module Text.DescriptorProtos.MethodOptions (MethodOptions(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data MethodOptions = MethodOptions{}-                   deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable MethodOptions where-  mergeEmpty = MethodOptions-  mergeAppend (MethodOptions) (MethodOptions) = MethodOptions- -instance P'.Default MethodOptions where-  defaultValue = MethodOptions- -instance P'.Wire MethodOptions where-  wireSize ft' self'@(MethodOptions)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = 0-  wirePut ft' self'@(MethodOptions)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.return ()-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> MethodOptions) MethodOptions where-  getVal m' f' = f' m'- -instance P'.GPB MethodOptions- -instance P'.ReflectDescriptor MethodOptions where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MethodOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"MethodOptions.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/ServiceDescriptorProto.hs
@@ -1,65 +0,0 @@-module Text.DescriptorProtos.ServiceDescriptorProto (ServiceDescriptorProto(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified Text.DescriptorProtos.MethodDescriptorProto as DescriptorProtos (MethodDescriptorProto)-import qualified Text.DescriptorProtos.ServiceOptions as DescriptorProtos (ServiceOptions)- -data ServiceDescriptorProto = ServiceDescriptorProto{name :: P'.Maybe P'.Utf8,-                                                     method :: P'.Seq DescriptorProtos.MethodDescriptorProto,-                                                     options :: P'.Maybe DescriptorProtos.ServiceOptions}-                            deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable ServiceDescriptorProto where-  mergeEmpty = ServiceDescriptorProto P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-  mergeAppend (ServiceDescriptorProto x'1 x'2 x'3) (ServiceDescriptorProto y'1 y'2 y'3)-    = ServiceDescriptorProto (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3)- -instance P'.Default ServiceDescriptorProto where-  defaultValue = ServiceDescriptorProto (P'.Just P'.defaultValue) P'.defaultValue (P'.Just P'.defaultValue)- -instance P'.Wire ServiceDescriptorProto where-  wireSize ft' self'@(ServiceDescriptorProto x'1 x'2 x'3)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 9 x'1 + P'.wireSizeRep 1 11 x'2 + P'.wireSizeOpt 1 11 x'3)-  wirePut ft' self'@(ServiceDescriptorProto x'1 x'2 x'3)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.wirePutOpt 10 9 x'1-              P'.wirePutRep 18 11 x'2-              P'.wirePutOpt 26 11 x'3-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{name = P'.Just new'Field}) (P'.wireGet 9)-              2 -> P'.fmap (\ new'Field -> old'Self{method = P'.append (method old'Self) new'Field}) (P'.wireGet 11)-              3 -> P'.fmap (\ new'Field -> old'Self{options = P'.mergeAppend (options old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> ServiceDescriptorProto) ServiceDescriptorProto where-  getVal m' f' = f' m'- -instance P'.GPB ServiceDescriptorProto- -instance P'.ReflectDescriptor ServiceDescriptorProto where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"ServiceDescriptorProto\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"ServiceDescriptorProto.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.ServiceDescriptorProto\", baseName = \"name\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.ServiceDescriptorProto\", baseName = \"method\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"MethodDescriptorProto\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos.ServiceDescriptorProto\", baseName = \"options\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 26}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"ServiceOptions\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/Text/DescriptorProtos/ServiceOptions.hs
@@ -1,54 +0,0 @@-module Text.DescriptorProtos.ServiceOptions (ServiceOptions(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data ServiceOptions = ServiceOptions{}-                    deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable ServiceOptions where-  mergeEmpty = ServiceOptions-  mergeAppend (ServiceOptions) (ServiceOptions) = ServiceOptions- -instance P'.Default ServiceOptions where-  defaultValue = ServiceOptions- -instance P'.Wire ServiceOptions where-  wireSize ft' self'@(ServiceOptions)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = 0-  wirePut ft' self'@(ServiceOptions)-    = case ft' of-        10 -> put'Fields-        11-          -> do-               P'.putSize (P'.wireSize 11 self')-               put'Fields-        _ -> P'.wirePutErr ft' self'-    where-        put'Fields-          = do-              P'.return ()-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> ServiceOptions) ServiceOptions where-  getVal m' f' = f' m'- -instance P'.GPB ServiceOptions- -instance P'.ReflectDescriptor ServiceOptions where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"Text\", parentModule = \"DescriptorProtos\", baseName = \"ServiceOptions\"}, descFilePath = [\"Text\",\"DescriptorProtos\",\"ServiceOptions.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− descriptor/descriptor.proto
@@ -1,286 +0,0 @@-// Protocol Buffers - Google's data interchange format-// Copyright 2008 Google Inc.-// http://code.google.com/p/protobuf/-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-//      http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--// Author: kenton@google.com (Kenton Varda)-//  Based on original Protocol Buffers design by-//  Sanjay Ghemawat, Jeff Dean, and others.-//-// The messages in this file describe the definitions found in .proto files.-// A valid .proto file can be translated directly to a FileDescriptorProto-// without any other information (e.g. without reading its imports).----package google.protobuf;-option java_package = "com.google.protobuf";-option java_outer_classname = "DescriptorProtos";--// descriptor.proto must be optimized for speed because reflection-based-// algorithms don't work during bootstrapping.-option optimize_for = SPEED;--// Describes a complete .proto file.-message FileDescriptorProto {-  optional string name = 1;       // file name, relative to root of source tree-  optional string package = 2;    // e.g. "foo", "foo.bar", etc.--  // Names of files imported by this file.-  repeated string dependency = 3;--  // All top-level definitions in this file.-  repeated DescriptorProto message_type = 4;-  repeated EnumDescriptorProto enum_type = 5;-  repeated ServiceDescriptorProto service = 6;-  repeated FieldDescriptorProto extension = 7;--  optional FileOptions options = 8;-}--// Describes a message type.-message DescriptorProto {-  optional string name = 1;--  repeated FieldDescriptorProto field = 2;-  repeated FieldDescriptorProto extension = 6;--  repeated DescriptorProto nested_type = 3;-  repeated EnumDescriptorProto enum_type = 4;--  message ExtensionRange {-    optional int32 start = 1;-    optional int32 end = 2;-  }-  repeated ExtensionRange extension_range = 5;--  optional MessageOptions options = 7;-}--// Describes a field within a message.-message FieldDescriptorProto {-  enum Type {-    // 0 is reserved for errors.-    // Order is weird for historical reasons.-    TYPE_DOUBLE         = 1;-    TYPE_FLOAT          = 2;-    TYPE_INT64          = 3;   // Not ZigZag encoded.  Negative numbers-                               // take 10 bytes.  Use TYPE_SINT64 if negative-                               // values are likely.-    TYPE_UINT64         = 4;-    TYPE_INT32          = 5;   // Not ZigZag encoded.  Negative numbers-                               // take 10 bytes.  Use TYPE_SINT32 if negative-                               // values are likely.-    TYPE_FIXED64        = 6;-    TYPE_FIXED32        = 7;-    TYPE_BOOL           = 8;-    TYPE_STRING         = 9;-    TYPE_GROUP          = 10;  // Tag-delimited aggregate.-    TYPE_MESSAGE        = 11;  // Length-delimited aggregate.--    // New in version 2.-    TYPE_BYTES          = 12;-    TYPE_UINT32         = 13;-    TYPE_ENUM           = 14;-    TYPE_SFIXED32       = 15;-    TYPE_SFIXED64       = 16;-    TYPE_SINT32         = 17;  // Uses ZigZag encoding.-    TYPE_SINT64         = 18;  // Uses ZigZag encoding.-  };--  enum Label {-    // 0 is reserved for errors-    LABEL_OPTIONAL      = 1;-    LABEL_REQUIRED      = 2;-    LABEL_REPEATED      = 3;-    // TODO(sanjay): Should we add LABEL_MAP?-  };--  optional string name = 1;-  optional int32 number = 3;-  optional Label label = 4;--  // If type_name is set, this need not be set.  If both this and type_name-  // are set, this must be either TYPE_ENUM or TYPE_MESSAGE.-  optional Type type = 5;--  // For message and enum types, this is the name of the type.  If the name-  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping-  // rules are used to find the type (i.e. first the nested types within this-  // message are searched, then within the parent, on up to the root-  // namespace).-  optional string type_name = 6;--  // For extensions, this is the name of the type being extended.  It is-  // resolved in the same manner as type_name.-  optional string extendee = 2;--  // For numeric types, contains the original text representation of the value.-  // For booleans, "true" or "false".-  // For strings, contains the default text contents (not escaped in any way).-  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.-  // TODO(kenton):  Base-64 encode?-  optional string default_value = 7;--  optional FieldOptions options = 8;-}--// Describes an enum type.-message EnumDescriptorProto {-  optional string name = 1;--  repeated EnumValueDescriptorProto value = 2;--  optional EnumOptions options = 3;-}--// Describes a value within an enum.-message EnumValueDescriptorProto {-  optional string name = 1;-  optional int32 number = 2;--  optional EnumValueOptions options = 3;-}--// Describes a service.-message ServiceDescriptorProto {-  optional string name = 1;-  repeated MethodDescriptorProto method = 2;--  optional ServiceOptions options = 3;-}--// Describes a method of a service.-message MethodDescriptorProto {-  optional string name = 1;--  // Input and output type names.  These are resolved in the same way as-  // FieldDescriptorProto.type_name, but must refer to a message type.-  optional string input_type = 2;-  optional string output_type = 3;--  optional MethodOptions options = 4;-}--// ===================================================================-// Options--// Each of the definitions above may have "options" attached.  These are-// just annotations which may cause code to be generated slightly differently-// or may contain hints for code that manipulates protocol messages.--// TODO(kenton):  Allow extensions to options.--message FileOptions {--  // Sets the Java package where classes generated from this .proto will be-  // placed.  By default, the proto package is used, but this is often-  // inappropriate because proto packages do not normally start with backwards-  // domain names.-  optional string java_package = 1;---  // If set, all the classes from the .proto file are wrapped in a single-  // outer class with the given name.  This applies to both Proto1-  // (equivalent to the old "--one_java_file" option) and Proto2 (where-  // a .proto always translates to a single class, but you may want to-  // explicitly choose the class name).-  optional string java_outer_classname = 8;--  // If set true, then the Java code generator will generate a separate .java-  // file for each top-level message, enum, and service defined in the .proto-  // file.  Thus, these types will *not* be nested inside the outer class-  // named by java_outer_classname.  However, the outer class will still be-  // generated to contain the file's getDescriptor() method as well as any-  // top-level extensions defined in the file.-  optional bool java_multiple_files = 10 [default=false];--  // Generated classes can be optimized for speed or code size.-  enum OptimizeMode {-    SPEED = 1;      // Generate complete code for parsing, serialization, etc.-    CODE_SIZE = 2;  // Use ReflectionOps to implement these methods.-  }-  optional OptimizeMode optimize_for = 9 [default=CODE_SIZE];-}--message MessageOptions {-  // Set true to use the old proto1 MessageSet wire format for extensions.-  // This is provided for backwards-compatibility with the MessageSet wire-  // format.  You should not use this for any other reason:  It's less-  // efficient, has fewer features, and is more complicated.-  //-  // The message must be defined exactly as follows:-  //   message Foo {-  //     option message_set_wire_format = true;-  //     extensions 4 to max;-  //   }-  // Note that the message cannot have any defined fields; MessageSets only-  // have extensions.-  //-  // All extensions of your type must be singular messages; e.g. they cannot-  // be int32s, enums, or repeated messages.-  //-  // Because this is an option, the above two restrictions are not enforced by-  // the protocol compiler.-  optional bool message_set_wire_format = 1 [default=false];-}--message FieldOptions {-  // The ctype option instructs the C++ code generator to use a different-  // representation of the field than it normally would.  See the specific-  // options below.  This option is not yet implemented in the open source-  // release -- sorry, we'll try to include it in a future version!-  optional CType ctype = 1;-  enum CType {-    CORD = 1;--    STRING_PIECE = 2;-  }--  // EXPERIMENTAL.  DO NOT USE.-  // For "map" fields, the name of the field in the enclosed type that-  // is the key for this map.  For example, suppose we have:-  //   message Item {-  //     required string name = 1;-  //     required string value = 2;-  //   }-  //   message Config {-  //     repeated Item items = 1 [experimental_map_key="name"];-  //   }-  // In this situation, the map key for Item will be set to "name".-  // TODO: Fully-implement this, then remove the "experimental_" prefix.-  optional string experimental_map_key = 9;-}--message EnumOptions {-}--message EnumValueOptions {-}--message ServiceOptions {--  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC-  //   framework.  We apologize for hoarding these numbers to ourselves, but-  //   we were already using them long before we decided to release Protocol-  //   Buffers.-}--message MethodOptions {--  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC-  //   framework.  We apologize for hoarding these numbers to ourselves, but-  //   we were already using them long before we decided to release Protocol-  //   Buffers.-}
− descriptor/protocol-buffers-descriptor.cabal
@@ -1,77 +0,0 @@-name:           protocol-buffers-descriptor-version:        0.2.9-cabal-version:  >= 1.2-build-type:     Simple-license:        BSD3-license-file:   LICENSE-copyright:      (c) 2008 Christopher Edward Kuklewicz-author:         Christopher Edward Kuklewicz-maintainer:     Chris Kuklewicz <protobuf@personal.mightyreason.com>-stability:      Experimental-homepage:       http://hackage.haskell.org/cgi-bin/hackage-scripts/package/protocol-buffers-package-url:    http://darcs.haskell.org/packages/protocol-buffers2/-synopsis:       Self-description of Google Protocol Buffer specifications-description:    Uses protocol-buffers package-category:       Text-Tested-With:    GHC ==6.8.3-data-files:     descriptor.proto-extra-source-files: Setup.hs-                    doc.txt-                    TODO-                    README-                    Skeleton.hs-boot-                    google/protobuf/unittest.proto-                    google/protobuf/unittest_import.proto--- extra-tmp-files:--flag small_base-    description: Choose the new smaller, split-up base package.--Library-  ghc-options:  -O2-  exposed-modules: Text.DescriptorProtos-                   Text.DescriptorProtos.DescriptorProto-                   Text.DescriptorProtos.DescriptorProto.ExtensionRange-                   Text.DescriptorProtos.EnumDescriptorProto-                   Text.DescriptorProtos.EnumOptions-                   Text.DescriptorProtos.EnumValueDescriptorProto-                   Text.DescriptorProtos.EnumValueOptions-                   Text.DescriptorProtos.FieldDescriptorProto-                   Text.DescriptorProtos.FieldDescriptorProto.Label-                   Text.DescriptorProtos.FieldDescriptorProto.Type-                   Text.DescriptorProtos.FieldOptions-                   Text.DescriptorProtos.FieldOptions.CType-                   Text.DescriptorProtos.FileDescriptorProto-                   Text.DescriptorProtos.FileOptions-                   Text.DescriptorProtos.FileOptions.OptimizeMode-                   Text.DescriptorProtos.MessageOptions-                   Text.DescriptorProtos.MethodDescriptorProto-                   Text.DescriptorProtos.MethodOptions-                   Text.DescriptorProtos.ServiceDescriptorProto-                   Text.DescriptorProtos.ServiceOptions--  if flag(small_base)-        build-depends: base >= 3,-                       containers,-                       bytestring,-                       array,-                       filepath,-                       directory,-                       mtl,-                       QuickCheck-  else-        build-depends: base < 3--  build-depends:   protocol-buffers == 0.2.9-  extensions:      DeriveDataTypeable,-                   EmptyDataDecls,-                   FlexibleInstances,-                   GADTs,-                   GeneralizedNewtypeDeriving,-                   MagicHash,-                   PatternGuards,-                   RankNTypes,-                   ScopedTypeVariables,-                   TypeSynonymInstances,-                   MultiParamTypeClasses,-                   FunctionalDependencies
− examples/ABF

binary file changed (98 → absent bytes)

− examples/ABF2

binary file changed (129 → absent bytes)

− examples/add_person_haskell.hs
@@ -1,50 +0,0 @@-module Main where--import Control.Monad-import Text.ProtocolBuffers(messageGet,messagePut,Utf8(..),defaultValue)-import qualified Data.ByteString.Lazy as L(readFile,writeFile,null)-import System-import Data.Char-import Data.Maybe(fromMaybe)-import qualified Data.ByteString.Lazy.UTF8 as U(fromString)-import qualified System.IO.UTF8 as U(getLine,putStr)-import Data.Sequence((|>),empty)--import AddressBookProtos.AddressBook-import AddressBookProtos.Person as Person-import AddressBookProtos.Person.PhoneNumber-import AddressBookProtos.Person.PhoneType---mayRead s = case reads s of ((x,_):_) -> Just x ; _ -> Nothing--main = do-  args <- getArgs-  file <- case args of-            [file] -> return file-            _ -> getProgName >>= \self -> error $ "Usage "++self++" ADDRESS_BOOK_FILE"-  f <- L.readFile file-  newBook <- case messageGet f of-               Left msg -> error ("Failed to parse address book.\n"++msg)-               Right (address_book,_) -> promptForAddress address_book-  seq newBook $ L.writeFile file (messagePut newBook)--inStr prompt = U.putStr prompt >> getLine-inUtf8 prompt = inStr prompt >>= return . Utf8 . U.fromString--promptForAddress :: AddressBook -> IO AddressBook-promptForAddress address_book = do-  p <- liftM3 (\i n e -> defaultValue { Person.id = i, name = n, email = if L.null (utf8 e) then Nothing else Just e})-              (fmap read  $ inStr "Enter person ID number: ")-              (inUtf8 "Enter name: ")-              (inUtf8 "Enter email address (blank for none): ")-  p' <- getPhone p-  return (address_book { person = person address_book |> p' })--getPhone :: Person -> IO Person-getPhone p' = do-  n <- inUtf8 "Enter a phone number (or leave blank to finish): "-  if L.null(utf8 n)-    then return p'-    else do t <- fmap (mayRead . map toUpper) (inStr "Is this a mobile, home, or work phone? ")-            getPhone (p' { phone = phone p' |> defaultValue { number = n, type' = t }})
− examples/addressbook.proto
@@ -1,30 +0,0 @@-// See README.txt for information and build instructions.--package tutorial;--option java_package = "com.example.tutorial";-option java_outer_classname = "AddressBookProtos";--message Person {-  required string name = 1;-  required int32 id = 2;        // Unique ID number for this person.-  optional string email = 3;--  enum PhoneType {-    MOBILE = 0;-    HOME = 1;-    WORK = 2;-  }--  message PhoneNumber {-    required string number = 1;-    optional PhoneType type = 2 [default = HOME];-  }--  repeated PhoneNumber phone = 4;-}--// Our address book file is just one of these.-message AddressBook {-  repeated Person person = 1;-}
− examples/list_people_haskell.hs
@@ -1,39 +0,0 @@-module Main where--import Control.Monad(when)-import qualified Data.ByteString.Lazy as L(readFile)-import qualified Data.Foldable as F(forM_)-import System.Environment(getArgs,getProgName)-import qualified Data.ByteString.Lazy.UTF8 as U(toString)-import qualified System.IO.UTF8 as U(putStrLn)--import Text.ProtocolBuffers(messageGet,utf8,isSet,getVal)--import AddressBookProtos.AddressBook(person)-import AddressBookProtos.Person as Person(id,name,email,phone)-import AddressBookProtos.Person.PhoneNumber(number,type')-import AddressBookProtos.Person.PhoneType(PhoneType(MOBILE,HOME,WORK))--outLn = U.putStrLn . U.toString . utf8--listPeople address_book =-  F.forM_ (person address_book) $ \person -> do-    putStr "Person ID: " >> print (Person.id person)-    putStr "  Name: " >> outLn (name person)-    when (isSet person email) $ do-      putStr "  E-mail address: " >> outLn (getVal person email)-    F.forM_ (phone person) $ \phone_number -> do-      putStr $ case getVal phone_number type' of-                 MOBILE -> "  Mobile phone #: "-                 HOME   -> "  Home phone #: "-                 WORK   -> "  Work phone #: "-      outLn (number phone_number)--main = do-  args <- getArgs-  f <- case args of-         [file] -> L.readFile file-         _ -> getProgName >>= \self -> error $ "Usage "++self++" ADDRESS_BOOK_FILE"-  case messageGet f of-    Left msg -> error ("Failed to parse address book.\n"++msg)-    Right (address_book,_) -> listPeople address_book
− hprotoc/LICENSE
@@ -1,10 +0,0 @@-Copyright (c) 2008, Christopher Edward Kuklewicz-All rights reserved.--Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:--    * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.-    * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.-    * Neither the name of the copyright holder nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission.--THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
− hprotoc/Setup.hs
@@ -1,2 +0,0 @@-import Distribution.Simple-main = defaultMainWithHooks defaultUserHooks
− hprotoc/Text/ProtocolBuffers/ProtoCompile.hs
@@ -1,136 +0,0 @@--- | This is the Main module for the command line program-module Main where--import qualified Data.Map as M-import Data.Version-import Language.Haskell.Pretty(prettyPrintStyleMode,Style(..),Mode(..),PPHsMode(..),PPLayout(..))-import System.Console.GetOpt-import System.Environment-import System.Directory-import System.FilePath--import Text.ProtocolBuffers.Reflections(ProtoInfo(..),DescriptorInfo(..),EnumInfo(..))--import Text.ProtocolBuffers.ProtoCompile.Gen(protoModule,descriptorModule,enumModule)-import Text.ProtocolBuffers.ProtoCompile.Resolve(loadProto)-import Text.ProtocolBuffers.ProtoCompile.MakeReflections(makeProtoInfo,serializeFDP)---- | Version of protocol-buffers.--- The version tags that I have used are ["unreleased"]-version :: Version-version = Version { versionBranch = [0,2,9]-                  , versionTags = [] }--data Options = Options { optPrefix :: String-                       , optTarget :: FilePath-                       , optInclude :: [FilePath]-                       , optProto :: FilePath-                       , optVerbose :: Bool-                       , optUnkownFields :: Bool }-  deriving Show--setPrefix,setTarget,setInclude,setProto :: String -> Options -> Options-setVerbose,setUnknown :: Options -> Options-setPrefix   s o = o { optPrefix = s }-setTarget   s o = o { optTarget = s }-setInclude  s o = o { optInclude = s : optInclude o }-setProto    s o = o { optProto = s }-setVerbose    o = o { optVerbose = True }-setUnknown    o = o { optUnkownFields = True }--data OptionAction = Mutate (Options->Options) | Run (Options->Options) | Switch Flag--data Flag = VersionInfo--optionList :: [OptDescr OptionAction]-optionList =-  [ Option ['I'] ["proto_path"] (ReqArg (Mutate . setInclude) "DIR")-               "directory from which to search for imported proto files (default is pwd); all DIR searched"-  , Option ['o'] ["haskell_out"] (ReqArg (Mutate . setTarget) "DIR")-               "directory to use are root of generated files (default is pwd); last flag"-  , Option ['p'] ["prefix"] (ReqArg (Mutate . setPrefix) "MODULE")-               "dotted haskell MODULE name to use as prefix (default is none); last flag used"-  , Option ['u'] ["unknown-fields"] (NoArg (Mutate setUnknown))-               "UNIMPLEMENTED: generated messages and groups all support unknown fields"-  , Option ['v'] ["verbose"] (NoArg (Mutate  setVerbose))-               "increase amount of printed information"-  , Option [] ["version"]  (NoArg (Switch VersionInfo))-               "print out version information"-  ]--usageMsg,versionInfo :: String-usageMsg = usageInfo "Usage: protoCompile [OPTION..] path-to-file.proto ..." optionList--versionInfo = unlines $-  [ "Welcome to protocol-buffers version "++showVersion version-  , "Copyright (c) 2008, Christopher Kuklewicz."-  , "Released under BSD3 style license, see LICENSE file for details."-  , "Some proto files, such as descriptor.proto and unittest*.proto"-  , "are from google's code and are under an Apache 2.0 license."-  , ""-  , "This program reads a .proto file and generates haskell code files."-  , "See http://code.google.com/apis/protocolbuffers/docs/overview.html for more."-  ]--processOptions :: [String] -> Either String [OptionAction]-processOptions argv =-    case getOpt (ReturnInOrder (Run . setProto)) optionList argv of-    (opts,_,[]) -> Right opts-    (_,_,errs) -> Left (unlines errs ++ usageMsg)--defaultOptions :: IO Options-defaultOptions = do-  pwd <- getCurrentDirectory-  return $ Options { optPrefix = "", optTarget = pwd, optInclude = [pwd], optProto = "", optVerbose = False, optUnkownFields = False }--main :: IO ()-main = do-  defs <- defaultOptions-  args <- getArgs-  case processOptions args of-    Left msg -> putStrLn msg-    Right todo -> process defs todo--process :: Options -> [OptionAction] -> IO ()-process options [] = if null (optProto options)-                       then do putStrLn "No proto file specified (or empty proto file)"-                               putStrLn ""-                               putStrLn usageMsg-                       else putStrLn "Processing complete, have a nice day."-process options (Mutate f:rest) = process (f options) rest-process options (Run f:rest) = let options' = f options-                            in run options' >> process options' rest-process _options (Switch VersionInfo:_) = putStrLn versionInfo-  -mkdirFor :: FilePath -> IO ()-mkdirFor p = createDirectoryIfMissing True (takeDirectory p)--style :: Style-style = Style PageMode 132 0.5--myMode :: PPHsMode-myMode = PPHsMode 2 2 2 2 4 2 True PPOffsideRule False True--run :: Options -> IO ()-run options = do-  print options-  protos <- loadProto (optInclude options) (optProto options)-  let (Just (fdp,_,names)) = M.lookup (optProto options) protos-      protoInfo = makeProtoInfo (optPrefix options) names fdp-  let produceMSG di = do-        let file = combine (optTarget options) . joinPath . descFilePath $ di-        print file-        mkdirFor file-        writeFile file (prettyPrintStyleMode style myMode (descriptorModule di))-      produceENM ei = do-        let file = combine (optTarget options) . joinPath . enumFilePath $ ei-        print file-        mkdirFor file-        writeFile file (prettyPrintStyleMode style myMode (enumModule ei))-  mapM_ produceMSG (messages protoInfo)-  mapM_ produceENM (enums protoInfo)--  let file = combine (optTarget options) . joinPath . protoFilePath $ protoInfo-  print file-  writeFile file (prettyPrintStyleMode style myMode (protoModule protoInfo (serializeFDP fdp)))-
− hprotoc/Text/ProtocolBuffers/ProtoCompile/Gen.hs
@@ -1,682 +0,0 @@--- try "test", "testDesc", and "testLabel" to see sample output--- --- Obsolete : Turn *Proto into Language.Haskell.Exts.Syntax from haskell-src-exts package--- Now cut back to use just Language.Haskell.Syntax, see coments marked YYY for the Exts verision--- --- Note that this may eventually also generate hs-boot files to allow--- for breaking mutual recursion.  This is ignored for getting--- descriptor.proto running.------ Mangling: For the current moment, assume the mangling is done in a prior pass:---   (*) Uppercase all module names and type names and enum constants---   (*) lowercase all field names---   (*) add a prime after all field names than conflict with reserved words------ The names are also assumed to have become fully-qualified, and all--- the optional type codes have been set.------ default values are an awful mess.  They are documented in descriptor.proto as-{--  // For numeric types, contains the original text representation of the value.-  // For booleans, "true" or "false".-  // For strings, contains the default text contents (not escaped in any way).-  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.-  // TODO(kenton):  Base-64 encode?-  optional string default_value = 7;--}-module Text.ProtocolBuffers.ProtoCompile.Gen(protoModule,descriptorModule,enumModule,prettyPrint) where--import Text.ProtocolBuffers.Basic-import Text.ProtocolBuffers.Reflections(KeyInfo,HsDefault(..),DescriptorInfo(..),ProtoInfo(..),EnumInfo(..),ProtoName(..),FieldInfo(..))--import qualified Data.ByteString.Lazy.Char8 as LC(unpack)-import Data.Char(isUpper)-import qualified Data.Foldable as F(foldr,toList)-import Data.List(sort,sortBy,group,foldl',foldl1')-import Data.Function(on)-import Language.Haskell.Pretty(prettyPrint)-import Language.Haskell.Syntax-import qualified Data.Map as M-import qualified Data.Sequence as Seq(null,length)-import qualified Data.Set as S----import Debug.Trace(trace)--default (Int)---- -- -- -- Helper functions--noWhere :: [HsDecl]-noWhere = [] -- YYY noWhere = (HsBDecls [])--($$) :: HsExp -> HsExp -> HsExp-($$) = HsApp--infixl 1 $$--dotPre :: String -> String -> String-dotPre "" x = x-dotPre x "" = x-dotPre s x@('.':xs)  | '.' == last s = s ++ xs-                     | otherwise = s ++ x-dotPre s x | '.' == last s = s++x-           | otherwise = s++('.':x)--src :: SrcLoc-src = SrcLoc "No SrcLoc" 0 0--litIntP :: Integral x => x -> HsPat-litIntP x | x<0 = HsPParen $ HsPLit (HsInt (toInteger x))-          | otherwise = HsPLit (HsInt (toInteger x))--litInt :: Integral x => x -> HsExp-litInt x | x<0 = HsParen $ HsLit (HsInt (toInteger x))-         | otherwise = HsLit (HsInt (toInteger x))--typeApp :: String -> HsType -> HsType-typeApp s =  HsTyApp (HsTyCon (private s))--pvar :: String -> HsExp-pvar t = HsVar (private t)--lvar :: String -> HsExp-lvar t = HsVar (UnQual (HsIdent t))--private :: String -> HsQName-private t = Qual (Module "P'") (HsIdent t)--inst :: String -> [HsPat] -> HsExp -> HsDecl-inst s p r  = HsFunBind [HsMatch src (HsIdent s) p (HsUnGuardedRhs r) noWhere]--fqName :: ProtoName -> String-fqName (ProtoName a b c) = dotPre a (dotPre b c)--qualName :: ProtoName -> HsQName-qualName (ProtoName _prefix "" base) = UnQual (HsIdent base)-qualName (ProtoName _prefix parent base) = Qual (Module parent) (HsIdent base)--unqualName :: ProtoName -> HsQName-unqualName (ProtoName _prefix _parent base) = UnQual (HsIdent base)--mayQualName :: ProtoName -> ProtoName -> HsQName-mayQualName context name@(ProtoName prefix modname base) =-  if fqName context == dotPre prefix modname then UnQual (HsIdent base)-    else qualName name------------------------------------------------- EnumDescriptorProto module creation----------------------------------------------{--enumModule :: String -> D.EnumDescriptorProto -> HsModule-enumModule prefix e-    = let ei = makeEnumInfo prefix e--}-enumModule :: EnumInfo -> HsModule-enumModule ei-    = let protoName = enumName ei-      in HsModule src (Module (fqName protoName))-           (Just [HsEThingAll (UnQual (HsIdent (baseName protoName)))])-           (standardImports False) (enumDecls ei)--enumDecls :: EnumInfo -> [HsDecl]-enumDecls ei =  map ($ ei) [ enumX-                           , instanceMergeableEnum-                           , instanceBounded-                           , instanceDefaultEnum-                           , instanceEnum-                           , instanceWireEnum-                           , instanceGPB . enumName-                           , instanceMessageAPI . enumName-                           , instanceReflectEnum-                           ]--enumX :: EnumInfo -> HsDecl-enumX ei = HsDataDecl src [] (HsIdent (baseName (enumName ei))) [] (map enumValueX (enumValues ei)) derivesEnum-  where enumValueX (_,name) = HsConDecl src (HsIdent name) []--instanceMergeableEnum :: EnumInfo -> HsDecl-instanceMergeableEnum ei -  = HsInstDecl src [] (private "Mergeable") [HsTyCon (unqualName (enumName ei))] []--instanceBounded :: EnumInfo -> HsDecl-instanceBounded ei-    = HsInstDecl src [] (private "Bounded") [HsTyCon (unqualName (enumName ei))] -        [set "minBound" (head values),set "maxBound" (last values)]-  where values = enumValues ei-        set f (_,n) = inst f [] (HsCon (UnQual (HsIdent n)))--{- from google's descriptor.h, about line 346:--  // Get the field default value if cpp_type() == CPPTYPE_ENUM.  If no-  // explicit default was defined, the default is the first value defined-  // in the enum type (all enum types are required to have at least one value).-  // This never returns NULL.---}-instanceDefaultEnum :: EnumInfo -> HsDecl-instanceDefaultEnum ei-    = HsInstDecl src [] (private "Default") [HsTyCon (unqualName (enumName ei))]-      [ inst "defaultValue" [] firstValue ]-  where firstValue :: HsExp-        firstValue = case enumValues ei of-                       (:) (_,n) _ -> HsCon (UnQual (HsIdent n))-                       [] -> error $ "Impossible? EnumDescriptorProto had empty sequence of EnumValueDescriptorProto.\n" ++ show ei--instanceEnum :: EnumInfo -> HsDecl-instanceEnum ei-    = HsInstDecl src [] (private "Enum") [HsTyCon (unqualName (enumName ei))]-        (map HsFunBind [fromEnum',toEnum',succ',pred'])-  where values = enumValues ei-        fromEnum' = map fromEnum'one values-        fromEnum'one (v,n) = HsMatch src (HsIdent "fromEnum") [HsPApp (UnQual (HsIdent n)) []]-                               (HsUnGuardedRhs (litInt (getEnumCode v))) noWhere-        toEnum' = map toEnum'one values-        toEnum'one (v,n) = HsMatch src (HsIdent "toEnum") [litIntP (getEnumCode v)] -- enums cannot be negative so no parenthesis are required to protect a negative sign-                             (HsUnGuardedRhs (HsCon (UnQual (HsIdent n)))) noWhere-        succ' = zipWith (equate "succ") values (tail values)-        pred' = zipWith (equate "pred") (tail values) values-        equate f (_,n1) (_,n2) = HsMatch src (HsIdent f) [HsPApp (UnQual (HsIdent n1)) []]-                                   (HsUnGuardedRhs (HsCon (UnQual (HsIdent n2)))) noWhere---- fromEnum TYPE_ENUM == 14 :: Int-instanceWireEnum :: EnumInfo -> HsDecl-instanceWireEnum ei-    = HsInstDecl src [] (private "Wire") [HsTyCon (unqualName (enumName ei))]-        [ withName "wireSize", withName "wirePut", withGet, withGetErr ]-  where withName foo = inst foo [HsPVar (HsIdent "ft'"),HsPVar (HsIdent "enum")] rhs-          where rhs = pvar foo $$ lvar "ft'" $$-                        (HsParen $ pvar "fromEnum" $$ lvar "enum")-        withGet = inst "wireGet" [litIntP 14] rhs-          where rhs = pvar "fmap" $$ pvar "toEnum" $$-                        (HsParen $ pvar "wireGet" $$ HsLit (HsInt 14))-        withGetErr = inst "wireGet" [HsPVar (HsIdent "ft'")] rhs-          where rhs = pvar "wireGetErr" $$ lvar "ft'"--instanceGPB :: ProtoName -> HsDecl-instanceGPB protoName-    = HsInstDecl src [] (private "GPB") [HsTyCon (unqualName protoName)] []--instanceReflectEnum :: EnumInfo -> HsDecl-instanceReflectEnum ei-    = HsInstDecl src [] (private "ReflectEnum") [HsTyCon (unqualName (enumName ei))]-        [ inst "reflectEnum" [] ascList-        , inst "reflectEnumInfo" [ HsPWildCard ] ei' ]-  where (ProtoName a b c) = enumName ei-        values = enumValues ei-        ascList,ei',protoNameExp :: HsExp-        ascList = HsList (map one values)-          where one (v,ns) = HsTuple [litInt (getEnumCode v),HsLit (HsString ns),HsCon (UnQual (HsIdent ns))]-        ei' = foldl' HsApp (HsCon (private "EnumInfo")) [protoNameExp-                                                        ,HsList $ map (HsLit . HsString) (enumFilePath ei)-                                                        ,HsList (map two values)]-          where two (v,ns) = HsTuple [litInt (getEnumCode v),HsLit (HsString ns)]-        protoNameExp = HsParen $ foldl' HsApp (HsCon (private "ProtoName")) . map (HsLit . HsString) $ [a,b,c]------------------------------------------------- DescriptorProto module creation is unfinished---   There are difficult namespace issues-----------------------------------------------hasExt :: DescriptorInfo -> Bool-hasExt di = not (null (extRanges di))--protoModule :: ProtoInfo -> ByteString -> HsModule-protoModule pri@(ProtoInfo protoName _ _ keyInfos _ _ _) fdpBS-  = let exportKeys = map (HsEVar . UnQual . HsIdent . baseName . fieldName . snd) (F.toList keyInfos)-        exportNames = map (HsEVar . UnQual . HsIdent) ["protoInfo","fileDescriptorProto"]-        imports = protoImports ++ map formatImport (protoImport pri)-    in HsModule src (Module (fqName protoName)) (Just (exportKeys++exportNames)) imports (keysX protoName keyInfos ++ embed'ProtoInfo pri ++ embed'fdpBS fdpBS)-  where protoImports = standardImports (not . Seq.null . extensionKeys $ pri) ++-                       [ HsImportDecl src (Module "Text.DescriptorProtos.FileDescriptorProto") False Nothing-                           (Just (False,[HsIAbs (HsIdent "FileDescriptorProto")]))-                       , HsImportDecl src (Module "Text.ProtocolBuffers.Reflections") False Nothing-                           (Just (False,[HsIAbs (HsIdent "ProtoInfo")]))-                       , HsImportDecl src (Module "Text.ProtocolBuffers.WireMessage") True (Just (Module "P'"))-                           (Just (False,[HsIVar (HsIdent "wireGet,getFromBS")]))-                       ]-        formatImport (m,t) = HsImportDecl src (Module (dotPre (haskellPrefix protoName) (dotPre m t))) True-                               (Just (Module m)) (Just (False,[HsIAbs (HsIdent t)]))--protoImport :: ProtoInfo -> [(String,String)]-protoImport (ProtoInfo protoName _ _ keyInfos _ _ _)-    = map head . group . sort -      . filter (selfName /=)-      . concatMap withMod-      $ allNames-  where selfName = (parentModule protoName, baseName protoName)-        withMod (ProtoName _prefix "" _base) = []-        withMod (ProtoName _prefix modname base) = [(modname,base)]-        allNames = F.foldr (\(e,fi) rest -> e : addName fi rest) [] keyInfos-        addName fi rest = maybe rest (:rest) (typeName fi)--embed'ProtoInfo :: ProtoInfo -> [HsDecl]-embed'ProtoInfo pri = [ myType, myValue ]-  where myType = HsTypeSig src [ HsIdent "protoInfo" ] (HsQualType [] (HsTyCon (UnQual (HsIdent "ProtoInfo"))))-        myValue = HsPatBind src (HsPApp (UnQual (HsIdent "protoInfo")) []) (HsUnGuardedRhs $-                    pvar "read" $$ HsLit (HsString (show pri))) noWhere--embed'fdpBS :: ByteString -> [HsDecl]-embed'fdpBS bs = [ myType, myValue ]-  where myType = HsTypeSig src [ HsIdent "fileDescriptorProto" ] (HsQualType [] (HsTyCon (UnQual (HsIdent "FileDescriptorProto"))))-        myValue = HsPatBind src (HsPApp (UnQual (HsIdent "fileDescriptorProto")) []) (HsUnGuardedRhs $-                    pvar "getFromBS" $$-                      HsParen (pvar "wireGet" $$ litInt 11) $$ -                      HsParen (pvar "pack" $$ HsLit (HsString (LC.unpack bs)))) noWhere--descriptorModule :: DescriptorInfo -> HsModule-descriptorModule di-    = let protoName = descName di-          un = UnQual . HsIdent . baseName $ protoName-          imports = standardImports (hasExt di) ++ map formatImport (toImport di)-          exportKeys = map (HsEVar . UnQual . HsIdent . baseName . fieldName . snd) (F.toList (keys di))-          formatImport ((a,b),s) = HsImportDecl src (Module a) True (Just (Module b)) (Just (False,-                                      map (HsIAbs . HsIdent) (S.toList s)))-      in HsModule src (Module (fqName protoName))-           (Just (HsEThingAll un : exportKeys))-           imports (descriptorX di : (keysX protoName (keys di) ++ instancesDescriptor di))--standardImports :: Bool -> [HsImportDecl]-standardImports ext =-  [ HsImportDecl src (Module "Prelude") False Nothing (Just (False,ops))-  , HsImportDecl src (Module "Prelude") True (Just (Module "P'")) Nothing-  , HsImportDecl src (Module "Text.ProtocolBuffers.Header") True (Just (Module "P'")) Nothing ]- where ops | ext = map (HsIVar . HsSymbol) ["+","<=","&&"," || "]-           | otherwise = map (HsIVar . HsSymbol) ["+"]--toImport :: DescriptorInfo -> [((String,String),S.Set String)]-toImport di-    = M.assocs . M.fromListWith S.union . filter isForeign . map withMod $ allNames-  where isForeign = let here = fqName protoName-                    in (\((a,_),_) -> a/=here)-        protoName = descName di-        withMod p@(ProtoName prefix modname base) | isUpper (head base) = ((fqName p,modname),S.singleton base)-                                                  | otherwise = ((dotPre prefix modname,modname),S.singleton base)-        allNames = F.foldr addName keyNames (fields di)-        keyNames = F.foldr (\(e,fi) rest -> e : addName fi rest) keysKnown (keys di)-        keysKnown = F.foldr (\fi rest -> fieldName fi : rest) [] (knownKeys di)---      keysKnown = F.foldr (\fi rest -> addName fi (fieldName fi : rest)) [] (knownKeys di)-        addName fi rest = maybe rest (:rest) (typeName fi)--keysX :: ProtoName -> Seq KeyInfo -> [HsDecl]-keysX self i = concatMap (makeKey self) . F.toList $ i--makeKey :: ProtoName -> KeyInfo -> [HsDecl]-makeKey self (extendee,f) = [ keyType, keyVal ]-  where keyType = HsTypeSig src [ HsIdent (baseName . fieldName $ f) ] (HsQualType [] (foldl1 HsTyApp . map HsTyCon $-                    [ private "Key", private labeled-                    , if extendee /= self then qualName extendee else unqualName extendee-                    , typeQName ]))-        labeled | canRepeat f = "Seq"-                | otherwise = "Maybe"-        typeNumber = getFieldType . typeCode $ f-        typeQName :: HsQName-        typeQName = case useType typeNumber of-                      Just s -> private s-                      Nothing -> case typeName f of-                                   Just s | self /= s -> qualName s-                                          | otherwise -> unqualName s-                                   Nothing -> error $  "No Name for Field!\n" ++ show f-        keyVal = HsPatBind src (HsPApp (UnQual (HsIdent (baseName (fieldName f)))) []) (HsUnGuardedRhs-                   (pvar "Key" $$ litInt (getFieldId (fieldNumber f))-                               $$ litInt typeNumber-                               $$ maybe (pvar "Nothing") (HsParen . (pvar "Just" $$) . (defToSyntax (typeCode f))) (hsDefault f)-                   )) noWhere--defToSyntax :: FieldType -> HsDefault -> HsExp-defToSyntax tc x =-  case x of-    HsDef'Bool b -> HsCon (private (show b))-    HsDef'ByteString bs -> (if tc == 9 then (\xx -> HsParen (pvar "Utf8" $$ xx)) else id) $-                           (HsParen $ pvar "pack" $$ HsLit (HsString (LC.unpack bs)))-    HsDef'Rational r | r < 0 -> HsParen $ HsLit (HsFrac r)-                     | otherwise -> HsLit (HsFrac r)-    HsDef'Integer i | i < 0 -> HsParen $ HsLit (HsInt i)-                    | otherwise -> HsLit (HsInt i)-    HsDef'Enum s -> HsParen $ pvar "read" $$ HsLit (HsString s)--descriptorX :: DescriptorInfo -> HsDecl-descriptorX di = HsDataDecl src [] name [] [con] derives-  where self = descName di-        name = HsIdent (baseName self)-        con = HsRecDecl src name eFields-                where eFields = F.foldr ((:) . fieldX) end (fields di)-                      end = if hasExt di then [extfield] else []-        extfield :: ([HsName],HsBangType)-        extfield = ([HsIdent "ext'field"],HsUnBangedTy (HsTyCon (Qual (Module "P'") (HsIdent "ExtField"))))--        fieldX :: FieldInfo -> ([HsName],HsBangType)-        fieldX fi = ([HsIdent (baseName $ fieldName fi)],HsUnBangedTy (labeled (HsTyCon typed)))-          where labeled | canRepeat fi = typeApp "Seq"-                        | isRequired fi = id-                        | otherwise = typeApp "Maybe"-                typed :: HsQName-                typed = case useType (getFieldType (typeCode fi)) of-                          Just s -> private s-                          Nothing -> case typeName fi of-                                       Just s | self /= s -> qualName s-                                              | otherwise -> unqualName s-                                       Nothing -> error $  "No Name for Field!\n" ++ show fi--instancesDescriptor :: DescriptorInfo -> [HsDecl]-instancesDescriptor di = map ($ di) $-   (if hasExt di then (instanceExtendMessage:) else id) $-   [ instanceMergeable-   , instanceDefault-   , instanceWireDescriptor-   , instanceMessageAPI . descName-   , instanceGPB . descName                 -   , instanceReflectDescriptor-   ]--instanceExtendMessage :: DescriptorInfo -> HsDecl-instanceExtendMessage di-    = HsInstDecl src [] (private "ExtendMessage") [HsTyCon (UnQual (HsIdent (baseName (descName di))))]-        [ inst "getExtField" [] (lvar "ext'field")-        , inst "putExtField" [HsPVar (HsIdent "e'f"),HsPVar (HsIdent "msg")] putextfield-        , inst "validExtRanges" [ HsPVar (HsIdent "msg") ] (pvar "extRanges" $$ (HsParen $ pvar "reflectDescriptorInfo" $$ lvar "msg"))-        ]-  where putextfield = HsRecUpdate (lvar "msg") [ HsFieldUpdate (UnQual (HsIdent "ext'field")) (lvar "e'f") ]--instanceMergeable :: DescriptorInfo -> HsDecl-instanceMergeable di-    = HsInstDecl src [] (private "Mergeable") [HsTyCon un]-        [ inst "mergeEmpty" [] (foldl' HsApp (HsCon un) (replicate len (HsCon (private "mergeEmpty"))))-        , inst "mergeAppend" [HsPApp un patternVars1, HsPApp un patternVars2]-                             (foldl' HsApp (HsCon un) (zipWith append vars1 vars2))-        ]-  where un = UnQual (HsIdent (baseName (descName di)))-        len = (if hasExt di then succ else id) $ Seq.length (fields di)-        patternVars1,patternVars2 :: [HsPat]-        patternVars1 = take len inf-            where inf = map (\n -> HsPVar (HsIdent ("x'" ++ show n))) [1..]-        patternVars2 = take len inf-            where inf = map (\n -> HsPVar (HsIdent ("y'" ++ show n))) [1..]-        vars1,vars2 :: [HsExp]-        vars1 = take len inf-            where inf = map (\n -> lvar ("x'" ++ show n)) [1..]-        vars2 = take len inf-            where inf = map (\n -> lvar ("y'" ++ show n)) [1..]-        append x y = HsParen $ pvar "mergeAppend" $$ x $$ y--instanceDefault :: DescriptorInfo -> HsDecl-instanceDefault di-    = HsInstDecl src [] (private "Default") [HsTyCon un]-        [ inst "defaultValue" [] (foldl' HsApp (HsCon un) deflistExt) ]-  where un = UnQual (HsIdent (baseName (descName di)))-        deflistExt = F.foldr ((:) . defX) end (fields di)-        end = if hasExt di then [pvar "defaultValue"] else []--        defX :: FieldInfo -> HsExp-        defX fi | isRequired fi = dv1-                | otherwise = dv2-          where dv1 = case hsDefault fi of-                        Nothing -> pvar "defaultValue"-                        Just hsdef -> defToSyntax (typeCode fi) hsdef-                dv2 = case hsDefault fi of-                        Nothing -> pvar "defaultValue"-                        Just hsdef -> HsParen $ HsCon (private "Just") $$ defToSyntax (typeCode fi) hsdef--instanceMessageAPI :: ProtoName -> HsDecl-instanceMessageAPI protoName-    = HsInstDecl src [] (private "MessageAPI") [HsTyVar (HsIdent "msg'"), HsTyFun (HsTyVar (HsIdent "msg'")) (HsTyCon un),  (HsTyCon un)]-        [ inst "getVal" [HsPVar (HsIdent "m'"),HsPVar (HsIdent "f'")] (HsApp (lvar "f'" ) (lvar "m'")) ]-  where un = UnQual (HsIdent (baseName protoName))--mkOp :: String -> HsExp -> HsExp -> HsExp-mkOp s a b = HsInfixApp a (HsQVarOp (UnQual (HsSymbol s))) b--{--        isAllowed x = pvar "or" $$ HsList ranges where-          (<=!) = mkOp "<="; (&&!) = mkOp "&&"; -- (||!) = mkOp "||"-          ranges = map (\(FieldId lo,FieldId hi) -> (litInt lo <=! x) &&! (x <=! litInt hi)) allowedExts--}-instanceWireDescriptor :: DescriptorInfo -> HsDecl-instanceWireDescriptor (DescriptorInfo { descName = protoName-                                       , fields = fieldInfos-                                       , extRanges = allowedExts-                                       , knownKeys = fieldExts })-  = let me = unqualName protoName-        extensible = not (null allowedExts)-        len = (if extensible then succ else id) $ Seq.length fieldInfos-        mine = HsPApp me . take len . map (\n -> HsPVar (HsIdent ("x'" ++ show n))) $ [1..]-        vars = take len . map (\n -> lvar ("x'" ++ show n)) $ [1..]--        cases g m e = HsCase (lvar "ft'") [ HsAlt src (litIntP 10) (HsUnGuardedAlt g) noWhere-                                          , HsAlt src (litIntP 11) (HsUnGuardedAlt m) noWhere-                                          , HsAlt src HsPWildCard (HsUnGuardedAlt e) noWhere-                                          ]--        sizeCases = HsUnGuardedRhs $ cases (lvar "calc'Size") -                                           (pvar "prependMessageSize" $$ lvar "calc'Size")-                                           (pvar "wireSizeErr" $$ lvar "ft'" $$ lvar "self'")-        whereCalcSize = [HsFunBind [HsMatch src (HsIdent "calc'Size") [] (HsUnGuardedRhs sizes) noWhere]]-        sizes | null sizesListExt = HsLit (HsInt 0)-              | otherwise = HsParen (foldl1' (+!) sizesListExt)-          where (+!) = mkOp "+"-                sizesListExt | extensible = sizesList ++ [ pvar "wireSizeExtField" $$ last vars ]-                             | otherwise = sizesList-                sizesList =  zipWith toSize vars . F.toList $ fieldInfos-        toSize var fi = let f = if isRequired fi then "wireSizeReq"-                                  else if canRepeat fi then "wireSizeRep"-                                      else "wireSizeOpt"-                        in foldl' HsApp (pvar f) [ litInt (wireTagLength fi)-                                                 , litInt (getFieldType (typeCode fi))-                                                 , var]--        putCases = HsUnGuardedRhs $ cases-          (lvar "put'Fields")-          (HsDo [ HsQualifier $ pvar "putSize" $$-                    (HsParen $ foldl' HsApp (pvar "wireSize") [ litInt 10 , lvar "self'" ])-                , HsQualifier $ lvar "put'Fields" ])-          (pvar "wirePutErr" $$ lvar "ft'" $$ lvar "self'")-        wherePutFields = [HsFunBind [HsMatch src (HsIdent "put'Fields") [] (HsUnGuardedRhs (HsDo putStmts)) noWhere]]-        putStmts = putStmtsContent-          where putStmtsContent | null putStmtsListExt = [HsQualifier $ pvar "return" $$ HsCon (Special HsUnitCon)]-                                | otherwise = putStmtsListExt-                putStmtsListExt | extensible = sortedPutStmtsList ++ [ HsQualifier $ pvar "wirePutExtField" $$ last vars ]-                                | otherwise = sortedPutStmtsList-                sortedPutStmtsList = map snd                                          -- remove number-                                     . sortBy (compare `on` fst)                      -- sort by number-                                     . zip (map fieldNumber . F.toList $ fieldInfos)  -- add number as fst-                                     $ putStmtsList-                putStmtsList = zipWith toPut vars . F.toList $ fieldInfos-        toPut var fi = let f = if isRequired fi then "wirePutReq"-                                 else if canRepeat fi then "wirePutRep"-                                     else "wirePutOpt"-                       in HsQualifier $-                          foldl' HsApp (pvar f) [ litInt (getWireTag (wireTag fi))-                                                , litInt (getFieldType (typeCode fi))-                                                , var]--        getCases = HsUnGuardedRhs $ cases-          (pvar (if extensible then "getBareMessageExt" else "getBareMessage") $$ lvar "update'Self")-          (pvar (if extensible then "getMessageExt" else "getMessage") $$ lvar "update'Self")-          (pvar "wireGetErr" $$ lvar "ft'")-        whereUpdateSelf = [HsFunBind [HsMatch src (HsIdent "update'Self")-                            [HsPVar (HsIdent "field'Number") ,HsPVar (HsIdent "old'Self")]-                            (HsUnGuardedRhs (HsCase (lvar "field'Number") updateAlts)) noWhere]]-        updateAlts = map toUpdate (F.toList fieldInfos) -                     ++ (if extensible && (not (Seq.null fieldExts)) then map toUpdateExt (F.toList fieldExts) else [])-                     ++ [HsAlt src HsPWildCard (HsUnGuardedAlt $-                           pvar "unknownField" $$ (lvar "field'Number")) noWhere]-        toUpdateExt fi = HsAlt src (litIntP . getFieldId . fieldNumber $ fi) (HsUnGuardedAlt $-                           pvar "wireGetKey" $$ HsVar (mayQualName protoName (fieldName fi)) $$ lvar "old'Self") noWhere-        -- fieldIds cannot be negative so no parenthesis are required to protect a negative sign-        toUpdate fi = HsAlt src (litIntP . getFieldId . fieldNumber $ fi) (HsUnGuardedAlt $ -                        pvar "fmap" $$ (HsParen $ HsLambda src [HsPVar (HsIdent "new'Field")] $-                                          HsRecUpdate (lvar "old'Self") [HsFieldUpdate (UnQual . HsIdent . baseName . fieldName $ fi)-                                                                                       (labelUpdate fi)])-                                    $$ (HsParen (pvar "wireGet" $$ (litInt . getFieldType . typeCode $ fi)))) noWhere-        labelUpdate fi | canRepeat fi = pvar "append" $$ HsParen ((lvar . baseName . fieldName $ fi) $$ lvar "old'Self")-                                                      $$ lvar "new'Field"-                       | isRequired fi = qMerge (lvar "new'Field")-                       | otherwise = qMerge (HsCon (private "Just") $$ lvar "new'Field")-            where qMerge x | fromIntegral (getFieldType (typeCode fi)) `elem` [10,11] =-                               pvar "mergeAppend" $$ HsParen ((lvar . baseName . fieldName $ fi) $$ lvar "old'Self") $$ (HsParen x)-                           | otherwise = x-         -    in HsInstDecl src [] (private "Wire") [HsTyCon me]-        [ HsFunBind [HsMatch src (HsIdent "wireSize") [HsPVar (HsIdent "ft'"),HsPAsPat (HsIdent "self'") (HsPParen mine)] sizeCases whereCalcSize]-        , HsFunBind [HsMatch src (HsIdent "wirePut")  [HsPVar (HsIdent "ft'"),HsPAsPat (HsIdent "self'") (HsPParen mine)] putCases wherePutFields]-        , HsFunBind [HsMatch src (HsIdent "wireGet") [HsPVar (HsIdent "ft'")] getCases whereUpdateSelf]-        ]--instanceReflectDescriptor :: DescriptorInfo -> HsDecl-instanceReflectDescriptor di-    = HsInstDecl src [] (private "ReflectDescriptor") [HsTyCon (UnQual (HsIdent (baseName (descName di))))]-        [ inst "reflectDescriptorInfo" [ HsPWildCard ] rdi ]-  where -- massive shortcut through show and read-        rdi :: HsExp-        rdi = pvar "read" $$ HsLit (HsString (show di))----------------------------------------------------------------------derives,derivesEnum :: [HsQName]-derives = map private ["Show","Eq","Ord","Typeable"]-derivesEnum = map private ["Read","Show","Eq","Ord","Typeable"]--useType :: Int -> Maybe String-useType  1 = Just "Double"-useType  2 = Just "Float"-useType  3 = Just "Int64"-useType  4 = Just "Word64"-useType  5 = Just "Int32"-useType  6 = Just "Word64"-useType  7 = Just "Word32"-useType  8 = Just "Bool"-useType  9 = Just "Utf8"-useType 10 = Nothing-useType 11 = Nothing-useType 12 = Just "ByteString"-useType 13 = Just "Word32"-useType 14 = Nothing-useType 15 = Just "Int32"-useType 16 = Just "Int64"-useType 17 = Just "Int32"-useType 18 = Just "Int64"-useType  x = error $ "Text.ProtocolBuffers.Gen: Impossible? useType Unknown type code "++show x--------------------------{--test = putStrLn . prettyPrint . descriptorModule False "Text" $ d'--testDesc =  putStrLn . prettyPrint . descriptorModule False "Text" $ genFieldOptions--testLabel = putStrLn . prettyPrint $ enumModule "Text" labelTest-testType = putStrLn . prettyPrint $ enumModule "Text" t---- testing-utf8FromString = Utf8 . U.fromString---- try and generate a small replacement for my manual file-genFieldOptions :: D.DescriptorProto.DescriptorProto-genFieldOptions =-  defaultValue-  { D.DescriptorProto.name = Just (utf8FromString "DescriptorProtos.FieldOptions") -  , D.DescriptorProto.field = Seq.fromList-    [ defaultValue-      { D.FieldDescriptorProto.name = Just (utf8FromString "ctype")-      , D.FieldDescriptorProto.number = Just 1-      , D.FieldDescriptorProto.label = Just LABEL_OPTIONAL-      , D.FieldDescriptorProto.type' = Just TYPE_ENUM-      , D.FieldDescriptorProto.type_name = Just (utf8FromString "DescriptorProtos.FieldOptions.CType")-      , D.FieldDescriptorProto.default_value = Nothing-      }-    , defaultValue-      { D.FieldDescriptorProto.name = Just (utf8FromString "experimental_map_key")-      , D.FieldDescriptorProto.number = Just 9-      , D.FieldDescriptorProto.label = Just LABEL_OPTIONAL-      , D.FieldDescriptorProto.type' = Just TYPE_STRING-      , D.FieldDescriptorProto.default_value = Nothing-      }-    ]-  }---- test several features-d' :: D.DescriptorProto.DescriptorProto-d' = defaultValue-    { D.DescriptorProto.name = Just (utf8FromString "SomeMod.ServiceOptions") -    , D.DescriptorProto.field = Seq.fromList-       [ defaultValue-         { D.FieldDescriptorProto.name = Just (utf8FromString "fieldString")-         , D.FieldDescriptorProto.number = Just 1-         , D.FieldDescriptorProto.label = Just LABEL_REQUIRED-         , D.FieldDescriptorProto.type' = Just TYPE_STRING-         , D.FieldDescriptorProto.default_value = Just (utf8FromString "Hello World")-         }-       , defaultValue-         { D.FieldDescriptorProto.name = Just (utf8FromString "fieldDouble")-         , D.FieldDescriptorProto.number = Just 4-         , D.FieldDescriptorProto.label = Just LABEL_OPTIONAL-         , D.FieldDescriptorProto.type' = Just TYPE_DOUBLE-         , D.FieldDescriptorProto.default_value = Just (utf8FromString "+5.5e-10")-        }-       , defaultValue-         { D.FieldDescriptorProto.name = Just (utf8FromString "fieldBytes")-         , D.FieldDescriptorProto.number = Just 2-         , D.FieldDescriptorProto.label = Just LABEL_REQUIRED-         , D.FieldDescriptorProto.type' = Just TYPE_STRING-         , D.FieldDescriptorProto.default_value = Just (utf8FromString . map toEnum $ [0,5..255])-        }-       , defaultValue-         { D.FieldDescriptorProto.name = Just (utf8FromString "fieldInt64")-         , D.FieldDescriptorProto.number = Just 3-         , D.FieldDescriptorProto.label = Just LABEL_REQUIRED-         , D.FieldDescriptorProto.type' = Just TYPE_INT64-         , D.FieldDescriptorProto.default_value = Just (utf8FromString "-0x40")-        }-       , defaultValue-         { D.FieldDescriptorProto.name = Just (utf8FromString "fieldBool")-         , D.FieldDescriptorProto.number = Just 5-         , D.FieldDescriptorProto.label = Just LABEL_OPTIONAL-         , D.FieldDescriptorProto.type' = Just TYPE_STRING-         , D.FieldDescriptorProto.default_value = Just (utf8FromString "False")-        }-       , defaultValue-         { D.FieldDescriptorProto.name = Just (utf8FromString "field2TestSelf")-         , D.FieldDescriptorProto.number = Just 6-         , D.FieldDescriptorProto.label = Just LABEL_OPTIONAL-         , D.FieldDescriptorProto.type' = Just TYPE_MESSAGE-         , D.FieldDescriptorProto.type_name = Just (utf8FromString "ServiceOptions")-         }-       , defaultValue-         { D.FieldDescriptorProto.name = Just (utf8FromString "field3TestQualified")-         , D.FieldDescriptorProto.number = Just 7-         , D.FieldDescriptorProto.label = Just LABEL_REPEATED-         , D.FieldDescriptorProto.type' = Just TYPE_MESSAGE-         , D.FieldDescriptorProto.type_name = Just (utf8FromString "A.B.C.Label")-         }-       , defaultValue-         { D.FieldDescriptorProto.name = Just (utf8FromString "field4TestUnqualified")-         , D.FieldDescriptorProto.number = Just 8-         , D.FieldDescriptorProto.label = Just LABEL_REPEATED-         , D.FieldDescriptorProto.type' = Just TYPE_MESSAGE-         , D.FieldDescriptorProto.type_name = Just (utf8FromString "Maybe")-         }-       ]-    }--labelTest :: D.EnumDescriptorProto.EnumDescriptorProto-labelTest = defaultValue-    { D.EnumDescriptorProto.name = Just (utf8FromString "DescriptorProtos.FieldDescriptorProto.Label")-    , D.EnumDescriptorProto.value = Seq.fromList-      [ defaultValue { D.EnumValueDescriptorProto.name = Just (utf8FromString "LABEL_OPTIONAL")-                     , D.EnumValueDescriptorProto.number = Just 1 }-      , defaultValue { D.EnumValueDescriptorProto.name = Just (utf8FromString "LABEL_REQUIRED")-                     , D.EnumValueDescriptorProto.number = Just 2 }-      , defaultValue { D.EnumValueDescriptorProto.name = Just (utf8FromString "LABEL_REPEATED")-                     , D.EnumValueDescriptorProto.number = Just 3 }-      ]-    }--t :: D.EnumDescriptorProto.EnumDescriptorProto-t = defaultValue { D.EnumDescriptorProto.name = Just (utf8FromString "DescriptorProtos.FieldDescriptorProto.Type")-                 , D.EnumDescriptorProto.value = Seq.fromList . zipWith make [1..] $ names }-  where make :: Int32 -> String -> D.EnumValueDescriptorProto-        make i s = defaultValue { D.EnumValueDescriptorProto.name = Just (utf8FromString s)-                                , D.EnumValueDescriptorProto.number = Just i }-        names = ["TYPE_DOUBLE","TYPE_FLOAT","TYPE_INT64","TYPE_UINT64","TYPE_INT32"-                ,"TYPE_FIXED64","TYPE_FIXED32","TYPE_BOOL","TYPE_STRING","TYPE_GROUP"-                ,"TYPE_MESSAGE","TYPE_BYTES","TYPE_UINT32","TYPE_ENUM","TYPE_SFIXED32"-                ,"TYPE_SFIXED64","TYPE_SINT32","TYPE_SINT64"]--}
− hprotoc/Text/ProtocolBuffers/ProtoCompile/Instances.hs
@@ -1,79 +0,0 @@-module Text.ProtocolBuffers.ProtoCompile.Instances(showsType,parseType,showsLabel,parseLabel) where--import Text.ParserCombinators.ReadP-import Text.DescriptorProtos.FieldDescriptorProto.Type(Type(..))-import Text.DescriptorProtos.FieldDescriptorProto.Label(Label(..))--{--instance Show Type where-  showsPrec _ = showsType--instance Read Type where-  readsPrec _ = readP_to_S readType--}--showsLabel :: Label -> ShowS-showsLabel LABEL_OPTIONAL s = "optional" ++ s-showsLabel LABEL_REQUIRED s = "required" ++ s-showsLabel LABEL_REPEATED s = "repeated" ++ s--showsType :: Type -> ShowS-showsType TYPE_DOUBLE s = "double" ++ s-showsType TYPE_FLOAT s = "float" ++ s-showsType TYPE_INT64 s = "int64" ++ s-showsType TYPE_UINT64 s = "uint64" ++ s-showsType TYPE_INT32  s = "int32" ++ s-showsType TYPE_FIXED64 s = "fixed64" ++ s-showsType TYPE_FIXED32 s = "fixed32" ++ s-showsType TYPE_BOOL s = "bool" ++ s-showsType TYPE_STRING s = "string" ++ s-showsType TYPE_GROUP s = "group" ++ s-showsType TYPE_MESSAGE s = "message" ++ s-showsType TYPE_BYTES s = "bytes" ++ s-showsType TYPE_UINT32 s = "uint32" ++ s-showsType TYPE_ENUM s = "enum" ++ s-showsType TYPE_SFIXED32 s = "sfixed32" ++ s-showsType TYPE_SFIXED64 s = "sfixed64" ++ s-showsType TYPE_SINT32 s = "sint32" ++ s-showsType TYPE_SINT64 s = "sint64" ++ s--parseType :: String -> Maybe Type-parseType s = case readP_to_S readType s of-                [(val,[])] -> Just val-                _ -> Nothing--parseLabel :: String -> Maybe Label-parseLabel s = case readP_to_S readLabel s of-                [(val,[])] -> Just val-                _ -> Nothing--readLabel :: ReadP Label-readLabel = choice [ return LABEL_OPTIONAL << string "optional"-                   , return LABEL_REQUIRED << string "required"-                   , return LABEL_REPEATED << string "repeated"-                   ]--readType :: ReadP Type-readType = choice [ return TYPE_DOUBLE << string "double"-                  , return TYPE_FLOAT << string "float"-                  , return TYPE_INT64 << string "int64"-                  , return TYPE_UINT64 << string "uint64"-                  , return TYPE_INT32  << string "int32"-                  , return TYPE_FIXED64 << string "fixed64"-                  , return TYPE_FIXED32 << string "fixed32"-                  , return TYPE_BOOL << string "bool"-                  , return TYPE_STRING << string "string"-                  , return TYPE_GROUP << string "group"-                  , return TYPE_MESSAGE << string "message"-                  , return TYPE_BYTES << string "bytes"-                  , return TYPE_UINT32 << string "uint32"-                  , return TYPE_ENUM << string "enum"-                  , return TYPE_SFIXED32 << string "sfixed32"-                  , return TYPE_SFIXED64 << string "sfixed64"-                  , return TYPE_SINT32 << string "sint32"-                  , return TYPE_SINT64 << string "sint64"-                  ]--(<<) :: Monad m => m a -> m b -> m a-(<<) = flip (>>)-
− hprotoc/Text/ProtocolBuffers/ProtoCompile/Lexer.hs
@@ -1,451 +0,0 @@-{-# OPTIONS -cpp #-}-{-# LINE 1 "Text/ProtocolBuffers/ProtoCompile/Lexer.x" #-}--{-# OPTIONS_GHC -Wwarn #-}-module Text.ProtocolBuffers.ProtoCompile.Lexer (Lexed(..), alexScanTokens,getLinePos)  where--import Control.Monad.Error()-import Codec.Binary.UTF8.String(encode)-import qualified Data.ByteString.Lazy as L-import Data.Char(ord,isHexDigit,isOctDigit,toLower)-import Data.Word(Word8)-import Numeric(readHex,readOct,readDec,readSigned,readFloat)---#if __GLASGOW_HASKELL__ >= 603-#include "ghcconfig.h"-#elif defined(__GLASGOW_HASKELL__)-#include "config.h"-#endif-#if __GLASGOW_HASKELL__ >= 503-import Data.Array-import Data.Char (ord)-import Data.Array.Base (unsafeAt)-#else-import Array-import Char (ord)-#endif-{-# LINE 1 "templates/wrappers.hs" #-}-{-# LINE 1 "templates/wrappers.hs" #-}-{-# LINE 1 "<built-in>" #-}-{-# LINE 1 "<command line>" #-}-{-# LINE 1 "templates/wrappers.hs" #-}--- -------------------------------------------------------------------------------- Alex wrapper code.------ This code is in the PUBLIC DOMAIN; you may copy it freely and use--- it for any purpose whatsoever.----import qualified Data.ByteString.Lazy.Char8 as ByteString------ -------------------------------------------------------------------------------- The input type--{-# LINE 29 "templates/wrappers.hs" #-}---type AlexInput = (AlexPosn, 	-- current position,-		  Char,		-- previous char-		  ByteString.ByteString)	-- current input string--alexInputPrevChar :: AlexInput -> Char-alexInputPrevChar (p,c,s) = c--alexGetChar :: AlexInput -> Maybe (Char,AlexInput)-alexGetChar (p,_,cs) | ByteString.null cs = Nothing-                     | otherwise = let c   = ByteString.head cs-                                       cs' = ByteString.tail cs-                                       p'  = alexMove p c-                                    in p' `seq` cs' `seq` Just (c, (p', c, cs'))----- -------------------------------------------------------------------------------- Token positions---- `Posn' records the location of a token in the input text.  It has three--- fields: the address (number of chacaters preceding the token), line number--- and column of a token within the file. `start_pos' gives the position of the--- start of the file and `eof_pos' a standard encoding for the end of file.--- `move_pos' calculates the new position after traversing a given character,--- assuming the usual eight character tab stops.---data AlexPosn = AlexPn !Int !Int !Int-	deriving (Eq,Show)--alexStartPos :: AlexPosn-alexStartPos = AlexPn 0 1 1--alexMove :: AlexPosn -> Char -> AlexPosn-alexMove (AlexPn a l c) '\t' = AlexPn (a+1)  l     (((c+7) `div` 8)*8+1)-alexMove (AlexPn a l c) '\n' = AlexPn (a+1) (l+1)   1-alexMove (AlexPn a l c) _    = AlexPn (a+1)  l     (c+1)----- -------------------------------------------------------------------------------- Default monad--{-# LINE 150 "templates/wrappers.hs" #-}----- -------------------------------------------------------------------------------- Monad (with ByteString input)--{-# LINE 233 "templates/wrappers.hs" #-}----- -------------------------------------------------------------------------------- Basic wrapper--{-# LINE 255 "templates/wrappers.hs" #-}----- -------------------------------------------------------------------------------- Basic wrapper, ByteString version--{-# LINE 277 "templates/wrappers.hs" #-}----- -------------------------------------------------------------------------------- Posn wrapper---- Adds text positions to the basic model.--{-# LINE 294 "templates/wrappers.hs" #-}----- -------------------------------------------------------------------------------- Posn wrapper, ByteString version-----alexScanTokens :: ByteString -> [token]-alexScanTokens str = go (alexStartPos,'\n',str)-  where go inp@(pos,_,str) =-          case alexScan inp 0 of-                AlexEOF -> []-                AlexError _ -> error "lexical error"-                AlexSkip  inp' len     -> go inp'-                AlexToken inp' len act -> act pos (ByteString.take (fromIntegral len) str) : go inp'------ -------------------------------------------------------------------------------- GScan wrapper---- For compatibility with previous versions of Alex, and because we can.--alex_base :: Array Int Int-alex_base = listArray (0,74) [-8,-3,2,109,0,-26,7,8,9,10,-19,106,-21,-20,-17,-12,77,108,133,118,170,0,247,269,323,377,0,452,475,536,0,613,623,143,257,345,355,677,0,0,137,327,329,343,800,823,879,344,903,950,972,996,1018,346,330,331,1029,1090,1101,381,1163,1174,1185,1196,1231,537,1259,1336,1413,1490,1567,1625,1683,0,0]--alex_table :: Array Int Int-alex_table = listArray (0,1938) [0,3,2,3,3,3,2,2,2,2,2,2,2,2,2,2,11,-1,-1,-1,-1,11,11,10,3,11,54,8,5,2,12,42,73,73,2,6,73,19,71,15,23,17,17,17,17,17,17,17,17,17,0,73,0,73,0,0,0,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,73,0,73,0,67,0,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,67,73,-1,73,2,2,2,2,2,34,0,18,18,18,18,18,18,18,18,18,18,0,0,-1,0,0,0,2,0,0,0,0,35,-1,10,0,0,0,0,4,34,0,18,18,18,18,18,18,18,18,18,18,22,16,16,16,16,16,16,16,16,16,39,35,35,34,-1,18,18,18,18,18,18,18,18,18,18,33,33,33,33,33,33,33,33,33,33,0,35,0,0,0,0,0,0,35,0,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,45,0,0,0,0,35,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,34,0,24,24,24,24,24,24,24,24,31,31,32,32,32,32,32,32,32,32,32,32,34,35,24,24,24,24,24,24,24,24,31,31,-1,0,-1,-1,-1,0,0,0,28,0,-1,35,-1,-1,-1,0,-1,-1,0,-1,0,35,0,0,0,0,-1,-1,0,-1,28,0,0,0,39,0,0,39,39,0,28,39,34,35,24,24,24,24,24,24,24,24,31,31,-1,39,39,0,39,0,-1,36,28,36,-1,35,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,33,0,0,39,0,0,0,57,0,45,57,57,35,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,45,45,0,45,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,-1,57,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,27,27,27,27,27,27,27,27,27,27,0,0,0,0,0,0,0,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,27,0,0,0,0,-1,0,0,27,27,27,27,27,27,-1,-1,0,27,27,27,27,27,27,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,39,27,27,27,27,27,27,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,57,0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,34,0,31,31,31,31,31,31,31,31,31,31,32,32,32,32,32,32,32,32,32,32,0,35,0,0,0,0,-1,0,0,0,0,35,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,35,0,0,0,0,0,0,0,0,0,35,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,0,0,0,0,-1,0,0,0,0,0,39,0,0,0,0,0,0,0,0,46,46,46,46,46,46,46,46,46,46,0,0,0,0,40,0,0,46,46,46,46,46,46,48,49,49,49,49,49,49,49,-1,0,0,0,0,0,0,0,0,0,-1,0,0,45,0,0,0,0,46,46,46,46,46,46,-1,0,0,0,0,0,0,0,44,0,-1,0,45,0,0,39,0,0,0,0,0,0,0,0,47,47,47,47,47,47,47,47,47,47,0,0,0,0,0,39,44,47,47,47,47,47,47,-1,50,50,50,50,50,50,50,50,0,-1,0,0,0,0,0,0,0,0,0,0,45,-1,0,0,0,47,47,47,47,47,47,-1,0,0,0,0,0,0,39,0,0,0,0,0,45,-1,0,51,51,51,51,51,51,51,51,-1,0,0,0,0,39,0,0,0,0,0,0,-1,0,52,52,52,52,52,52,52,52,-1,-1,0,0,0,0,0,39,0,0,0,-1,0,0,45,0,53,53,53,53,53,53,53,53,0,0,0,0,0,39,0,0,0,0,0,39,45,0,53,53,53,53,53,53,53,53,0,0,0,58,58,58,58,58,58,58,58,58,58,0,45,0,-1,0,0,0,58,58,58,58,58,58,-1,-1,0,0,0,0,0,0,0,0,45,-1,0,0,0,0,0,0,0,0,0,57,0,0,41,0,58,58,58,58,58,58,0,0,0,39,0,0,60,61,61,61,61,61,61,61,0,0,0,59,59,59,59,59,59,59,59,59,59,0,0,0,0,-1,0,0,59,59,59,59,59,59,0,-1,-1,0,0,0,56,0,0,0,57,0,-1,-1,0,0,0,0,0,0,0,57,0,-1,-1,39,59,59,59,59,59,59,0,0,-1,0,39,0,56,62,62,62,62,62,62,62,62,39,0,0,63,63,63,63,63,63,63,63,39,-1,0,64,64,64,64,64,64,64,64,-1,0,0,65,65,65,65,65,65,65,65,0,0,0,57,0,0,0,0,0,0,0,0,0,39,57,0,0,0,0,0,0,0,0,0,0,57,0,65,65,65,65,65,65,65,65,0,57,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,72,0,68,68,68,68,68,68,68,68,68,68,0,0,0,0,0,0,57,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,0,0,0,0,68,0,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,72,0,68,68,68,68,68,68,68,68,68,68,0,0,0,0,0,0,0,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,0,0,0,0,68,0,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,72,0,68,68,68,68,68,68,68,68,68,68,0,0,0,0,0,0,0,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,0,0,0,0,68,0,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,68,72,0,70,70,70,70,70,70,70,70,70,70,0,0,0,0,0,0,0,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,0,0,0,0,70,0,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,72,0,70,70,70,70,70,70,70,70,70,70,0,0,0,0,0,0,0,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,0,0,0,0,70,0,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,70,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,0,0,0,0,66,0,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,66,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,0,0,0,0,69,0,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,69,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]--alex_check :: Array Int Int-alex_check = listArray (0,1938) [-1,9,10,11,12,13,9,10,11,12,13,9,10,11,12,13,42,10,10,10,10,42,42,42,32,42,34,35,47,32,42,39,40,41,32,47,44,45,46,47,48,49,50,51,52,53,54,55,56,57,-1,59,-1,61,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,-1,93,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,10,125,9,10,11,12,13,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,0,-1,-1,-1,32,-1,-1,-1,-1,69,10,42,-1,-1,-1,-1,47,46,-1,48,49,50,51,52,53,54,55,56,57,48,49,50,51,52,53,54,55,56,57,39,69,101,46,10,48,49,50,51,52,53,54,55,56,57,48,49,50,51,52,53,54,55,56,57,-1,69,-1,-1,-1,-1,-1,-1,101,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,92,-1,-1,-1,-1,101,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,46,-1,48,49,50,51,52,53,54,55,56,57,48,49,50,51,52,53,54,55,56,57,46,69,48,49,50,51,52,53,54,55,56,57,0,-1,0,0,0,-1,-1,-1,88,-1,10,69,10,10,10,-1,0,0,-1,0,-1,101,-1,-1,-1,-1,10,10,-1,10,88,-1,-1,-1,34,-1,-1,34,34,-1,120,39,46,101,48,49,50,51,52,53,54,55,56,57,0,39,39,-1,39,-1,10,43,120,45,10,69,48,49,50,51,52,53,54,55,56,57,48,49,50,51,52,53,54,55,56,57,-1,-1,34,-1,-1,-1,92,-1,92,92,92,101,48,49,50,51,52,53,54,55,56,57,92,92,-1,92,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,92,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,0,-1,-1,65,66,67,68,69,70,10,10,-1,97,98,99,100,101,102,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,34,97,98,99,100,101,102,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,92,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,46,-1,48,49,50,51,52,53,54,55,56,57,48,49,50,51,52,53,54,55,56,57,-1,69,-1,-1,-1,-1,10,-1,-1,-1,-1,69,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,101,-1,-1,-1,-1,-1,-1,-1,-1,-1,101,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,-1,-1,-1,-1,-1,39,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,39,-1,-1,65,66,67,68,69,70,48,49,50,51,52,53,54,55,0,-1,-1,-1,-1,-1,-1,-1,-1,-1,10,-1,-1,92,-1,-1,-1,-1,97,98,99,100,101,102,0,-1,-1,-1,-1,-1,-1,-1,88,-1,10,-1,92,-1,-1,39,-1,-1,-1,-1,-1,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,39,120,65,66,67,68,69,70,0,48,49,50,51,52,53,54,55,-1,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,92,0,-1,-1,-1,97,98,99,100,101,102,10,-1,-1,-1,-1,-1,-1,39,-1,-1,-1,-1,-1,92,0,-1,48,49,50,51,52,53,54,55,10,-1,-1,-1,-1,39,-1,-1,-1,-1,-1,-1,0,-1,48,49,50,51,52,53,54,55,10,0,-1,-1,-1,-1,-1,39,-1,-1,-1,10,-1,-1,92,-1,48,49,50,51,52,53,54,55,-1,-1,-1,-1,-1,39,-1,-1,-1,-1,-1,34,92,-1,48,49,50,51,52,53,54,55,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,92,-1,0,-1,-1,-1,65,66,67,68,69,70,10,0,-1,-1,-1,-1,-1,-1,-1,-1,92,10,-1,-1,-1,-1,-1,-1,-1,-1,-1,92,-1,-1,34,-1,97,98,99,100,101,102,-1,-1,-1,34,-1,-1,48,49,50,51,52,53,54,55,-1,-1,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,0,-1,-1,65,66,67,68,69,70,-1,10,0,-1,-1,-1,88,-1,-1,-1,92,-1,10,0,-1,-1,-1,-1,-1,-1,-1,92,-1,10,0,34,97,98,99,100,101,102,-1,-1,10,-1,34,-1,120,48,49,50,51,52,53,54,55,34,-1,-1,48,49,50,51,52,53,54,55,34,0,-1,48,49,50,51,52,53,54,55,10,-1,-1,48,49,50,51,52,53,54,55,-1,-1,-1,92,-1,-1,-1,-1,-1,-1,-1,-1,-1,34,92,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,92,-1,48,49,50,51,52,53,54,55,-1,92,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,92,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,46,-1,48,49,50,51,52,53,54,55,56,57,-1,-1,-1,-1,-1,-1,-1,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,-1,-1,-1,-1,95,-1,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1]--alex_deflt :: Array Int Int-alex_deflt = listArray (0,74) [74,-1,-1,-1,-1,13,7,7,9,9,13,14,13,13,13,-1,-1,-1,-1,-1,21,-1,-1,-1,-1,26,-1,-1,-1,30,-1,-1,-1,-1,-1,-1,-1,38,-1,-1,43,55,43,43,43,43,43,43,43,43,43,43,43,43,55,55,55,55,55,55,55,55,55,55,55,55,-1,-1,-1,-1,-1,-1,-1,-1,-1]--alex_accept = listArray (0::Int,74) [[],[],[(AlexAccSkip)],[(AlexAccSkip)],[(AlexAccSkip)],[(AlexAccSkip)],[(AlexAccSkip)],[(AlexAccSkip)],[(AlexAccSkip)],[(AlexAccSkip)],[],[],[],[],[],[(AlexAcc (alex_action_13))],[(AlexAccPred  (alex_action_2) (alexRightContext 20)),(AlexAccPred  (alex_action_5) (alexRightContext 37)),(AlexAcc (alex_action_6))],[(AlexAccPred  (alex_action_2) (alexRightContext 20)),(AlexAccPred  (alex_action_5) (alexRightContext 37)),(AlexAcc (alex_action_6))],[(AlexAccPred  (alex_action_2) (alexRightContext 20)),(AlexAccPred  (alex_action_5) (alexRightContext 37)),(AlexAcc (alex_action_6))],[(AlexAcc (alex_action_13))],[],[(AlexAccSkip)],[(AlexAccPred  (alex_action_3) (alexRightContext 25)),(AlexAccPred  (alex_action_5) (alexRightContext 37)),(AlexAcc (alex_action_7))],[(AlexAccPred  (alex_action_3) (alexRightContext 25)),(AlexAccPred  (alex_action_5) (alexRightContext 37)),(AlexAcc (alex_action_7))],[(AlexAccPred  (alex_action_3) (alexRightContext 25)),(AlexAccPred  (alex_action_5) (alexRightContext 37)),(AlexAcc (alex_action_7))],[],[(AlexAccSkip)],[(AlexAccPred  (alex_action_4) (alexRightContext 29)),(AlexAcc (alex_action_8))],[],[],[(AlexAccSkip)],[(AlexAccPred  (alex_action_5) (alexRightContext 37)),(AlexAcc (alex_action_9))],[(AlexAccPred  (alex_action_5) (alexRightContext 37)),(AlexAcc (alex_action_9))],[(AlexAccPred  (alex_action_5) (alexRightContext 37)),(AlexAcc (alex_action_9))],[],[],[],[],[(AlexAccSkip)],[(AlexAcc (alex_action_10))],[(AlexAcc (alex_action_10))],[(AlexAcc (alex_action_10))],[(AlexAcc (alex_action_13))],[],[],[],[],[],[],[],[],[],[],[],[(AlexAcc (alex_action_13))],[],[],[],[],[],[],[],[],[],[],[],[(AlexAcc (alex_action_11))],[(AlexAcc (alex_action_11))],[(AlexAcc (alex_action_11))],[(AlexAcc (alex_action_11))],[(AlexAcc (alex_action_11))],[(AlexAcc (alex_action_13))],[],[(AlexAcc (alex_action_12))],[(AlexAcc (alex_action_13))]]-{-# LINE 54 "Text/ProtocolBuffers/ProtoCompile/Lexer.x" #-}--line :: AlexPosn -> Int-line (AlexPn _byte lineNum _col) = lineNum-{-# INLINE line #-}--data Lexed = L_Integer !Int !Integer-           | L_Double !Int !Double-           | L_Name !Int !L.ByteString-           | L_String !Int !L.ByteString-           | L !Int !Char-           | L_Error !Int !String-  deriving (Show,Eq)--getLinePos :: Lexed -> Int-getLinePos x = case x of-                 L_Integer i _ -> i-                 L_Double  i _ -> i-                 L_Name    i _ -> i-                 L_String  i _ -> i-                 L         i _ -> i-                 L_Error   i _ -> i---- 'errAt' is the only access to L_Error, so I can see where it is created with pos-errAt pos msg =  L_Error (line pos) $ "Lexical error (in Text.ProtocolBuffers.Lexer): "++ msg ++ ", at "++see pos where-  see (AlexPn char lineNum col) = "character "++show char++" line "++show lineNum++" column "++show col++"."-dieAt msg pos _s = errAt pos msg-wtfAt pos s = errAt pos $ "unknown character "++show c++" (decimal "++show (ord c)++")"-  where (c:_) = ByteString.unpack s--{-# INLINE mayRead #-}-mayRead :: ReadS a -> String -> Maybe a-mayRead f s = case f s of [(a,"")] -> Just a; _ -> Nothing---- Given the regexps above, the "parse* failed" messages should be impossible.-parseDec pos s = maybe (errAt pos "Impossible? parseDec failed")-                       (L_Integer (line pos)) $ mayRead (readSigned readDec) (ByteString.unpack s)-parseOct pos s = maybe (errAt pos "Impossible? parseOct failed")-                       (L_Integer (line pos)) $ mayRead (readSigned readOct) (ByteString.unpack s)-parseHex pos s = maybe (errAt pos "Impossible? parseHex failed")-                       (L_Integer (line pos)) $ mayRead (readSigned (readHex . drop 2)) (ByteString.unpack s)-parseDouble pos s = maybe (errAt pos "Impossible? parseDouble failed")-                          (L_Double (line pos)) $ mayRead (readSigned readFloat) (ByteString.unpack s)--- The sDecode of the string contents may fail-parseStr pos s = either (errAt pos) (L_String (line pos) . L.pack) -               . sDecode . ByteString.unpack-               . ByteString.init . ByteString.tail-               $ s-parseName pos s = L_Name (line pos) s-parseChar pos s = L (line pos) (ByteString.head s)---- Generalization of concat . unfoldr to monadic-Either form:-op :: ( [Char] -> Either String (Maybe ([Word8],[Char]))) -> [Char] -> Either String [Word8]-op one = go id where-  go f cs = case one cs of-              Left msg -> Left msg-              Right Nothing -> Right (f [])-              Right (Just (ws,cs')) -> go (f . (ws++)) cs'---- Put this mess in the lexer, so the rest of the code can assume--- everything is saner.  The input is checked to really be "Char8"--- values in the range [0..255] and to be c-escaped (in order to--- render binary information printable).  This decodes the c-escaping--- and returns the binary data as Word8.--- --- A decoding error causes (Left msg) to be returned.-sDecode :: [Char] -> Either String [Word8]-sDecode = op one where-  one :: [Char] -> Either String (Maybe ([Word8],[Char]))-  one ('\\':xs) = unescape xs-  one (x:xs) = do x' <- checkChar8 x-                  return $ Just (x',xs)  -- main case of unescaped value-  one [] = return Nothing-  unescape [] = Left "cannot understand a string that ends with a backslash"-  unescape ys | 1 <= len =-      case mayRead readOct oct of-        Just w -> do w' <- checkByte w-                     return $ Just (w',rest)-        Nothing -> Left $ "failed to decode octal sequence "++ys-    where oct = takeWhile isOctDigit (take 3 ys)-          len = length oct-          rest = drop len ys-  unescape (x:ys) | 'x' == toLower x && 1 <= len =-      case mayRead readHex hex of-        Just w -> do w' <- checkByte w-                     return $ Just (w',rest)-        Nothing -> Left $ "failed to decode hex sequence "++ys-    where hex = takeWhile isHexDigit (take 2 ys)-          len = length hex-          rest = drop len ys          -  unescape ('u':ys) | ok =-      case mayRead readHex hex of-        Just w -> do w' <- checkUnicode w-                     return $ Just (w',rest)-        Nothing -> Left $ "failed to decode 4 char unicode sequence "++ys-    where ok = all isHexDigit hex && 4 == length hex-          (hex,rest) = splitAt 4 ys-  unescape ('U':ys) | ok =-      case mayRead readHex hex of-        Just w -> do w' <- checkUnicode w-                     return $ Just (w',rest)-        Nothing -> Left $ "failed to decode 8 char unicode sequence "++ys-    where ok = all isHexDigit hex && 8 == length hex-          (hex,rest) = splitAt 8 ys-  unescape (x:xs) = do x' <- decode x-                       return $ Just ([x'],xs)-  decode :: Char -> Either String Word8-  decode 'a' = return 7-  decode 'b' = return 8-  decode 't' = return 9-  decode 'n' = return 10-  decode 'v' = return 11-  decode 'f' = return 12-  decode 'r' = return 13-  decode '\"' = return 34-  decode '\'' = return 39-  decode '?' = return 63    -- C99 rule : "\?" is '?'-  decode '\\' = return 92-  decode x | toLower x == 'x' = Left "cannot understand your 'xX' hexadecimal escaped value"-  decode x | toLower x == 'u' = Left "cannot understand your 'uU' unicode UTF-8 hexadecimal escaped value"-  decode _ = Left "cannot understand your backslash-escaped value"-  checkChar8 :: Char -> Either String [Word8]-  checkChar8 c | (0 <= i) && (i <= 255) = Right [toEnum i]-               | otherwise = Left $ "found Char out of range 0..255, value="++show (ord c)-    where i = fromEnum c-  checkByte :: Integer -> Either String [Word8]-  checkByte i | (0 <= i) && (i <= 255) = Right [fromInteger i]-              | otherwise = Left $ "found Oct/Hex Int out of range 0..255, value="++show i-  checkUnicode :: Integer -> Either String [Word8]-  checkUnicode i | (0 <= i) && (i <= 127) = Right [fromInteger i]-                 | i <= maxChar = Right $ encode [ toEnum . fromInteger $ i ]-                 | otherwise = Left $ "found Unicode Char out of range 0..0x10FFFF, value="++show i-    where maxChar = toInteger (fromEnum (maxBound ::Char)) -- 0x10FFFF---alex_action_2 =  parseDec -alex_action_3 =  parseOct -alex_action_4 =  parseHex -alex_action_5 =  parseDouble -alex_action_6 =  dieAt "decimal followed by invalid character" -alex_action_7 =  dieAt "octal followed by invalid character" -alex_action_8 =  dieAt "hex followed by invalid character" -alex_action_9 =  dieAt "floating followed by invalid character" -alex_action_10 =  parseStr -alex_action_11 =  parseName -alex_action_12 =  parseChar -alex_action_13 =  wtfAt -{-# LINE 1 "templates/GenericTemplate.hs" #-}-{-# LINE 1 "templates/GenericTemplate.hs" #-}-{-# LINE 1 "<built-in>" #-}-{-# LINE 1 "<command line>" #-}-{-# LINE 1 "templates/GenericTemplate.hs" #-}--- -------------------------------------------------------------------------------- ALEX TEMPLATE------ This code is in the PUBLIC DOMAIN; you may copy it freely and use--- it for any purpose whatsoever.---- -------------------------------------------------------------------------------- INTERNALS and main scanner engine--{-# LINE 35 "templates/GenericTemplate.hs" #-}--{-# LINE 45 "templates/GenericTemplate.hs" #-}--{-# LINE 66 "templates/GenericTemplate.hs" #-}-alexIndexInt16OffAddr arr off = arr ! off---{-# LINE 87 "templates/GenericTemplate.hs" #-}-alexIndexInt32OffAddr arr off = arr ! off---{-# LINE 98 "templates/GenericTemplate.hs" #-}-quickIndex arr i = arr ! i----- -------------------------------------------------------------------------------- Main lexing routines--data AlexReturn a-  = AlexEOF-  | AlexError  !AlexInput-  | AlexSkip   !AlexInput !Int-  | AlexToken  !AlexInput !Int a---- alexScan :: AlexInput -> StartCode -> AlexReturn a-alexScan input (sc)-  = alexScanUser undefined input (sc)--alexScanUser user input (sc)-  = case alex_scan_tkn user input (0) input sc AlexNone of-	(AlexNone, input') ->-		case alexGetChar input of-			Nothing -> ----				   AlexEOF-			Just _ ->----				   AlexError input'--	(AlexLastSkip input len, _) ->----		AlexSkip input len--	(AlexLastAcc k input len, _) ->----		AlexToken input len k----- Push the input through the DFA, remembering the most recent accepting--- state it encountered.--alex_scan_tkn user orig_input len input s last_acc =-  input `seq` -- strict in the input-  let -	new_acc = check_accs (alex_accept `quickIndex` (s))-  in-  new_acc `seq`-  case alexGetChar input of-     Nothing -> (new_acc, input)-     Just (c, new_input) -> ----	let-		base   = alexIndexInt32OffAddr alex_base s-		(ord_c) = ord c-		offset = (base + ord_c)-		check  = alexIndexInt16OffAddr alex_check offset-		-		new_s = if (offset >= (0)) && (check == ord_c)-			  then alexIndexInt16OffAddr alex_table offset-			  else alexIndexInt16OffAddr alex_deflt s-	in-	case new_s of -	    (-1) -> (new_acc, input)-		-- on an error, we want to keep the input *before* the-		-- character that failed, not after.-    	    _ -> alex_scan_tkn user orig_input (len + (1)) -			new_input new_s new_acc--  where-	check_accs [] = last_acc-	check_accs (AlexAcc a : _) = AlexLastAcc a input (len)-	check_accs (AlexAccSkip : _)  = AlexLastSkip  input (len)-	check_accs (AlexAccPred a pred : rest)-	   | pred user orig_input (len) input-	   = AlexLastAcc a input (len)-	check_accs (AlexAccSkipPred pred : rest)-	   | pred user orig_input (len) input-	   = AlexLastSkip input (len)-	check_accs (_ : rest) = check_accs rest--data AlexLastAcc a-  = AlexNone-  | AlexLastAcc a !AlexInput !Int-  | AlexLastSkip  !AlexInput !Int--data AlexAcc a user-  = AlexAcc a-  | AlexAccSkip-  | AlexAccPred a (AlexAccPred user)-  | AlexAccSkipPred (AlexAccPred user)--type AlexAccPred user = user -> AlexInput -> Int -> AlexInput -> Bool---- -------------------------------------------------------------------------------- Predicates on a rule--alexAndPred p1 p2 user in1 len in2-  = p1 user in1 len in2 && p2 user in1 len in2----alexPrevCharIsPred :: Char -> AlexAccPred _ -alexPrevCharIs c _ input _ _ = c == alexInputPrevChar input----alexPrevCharIsOneOfPred :: Array Char Bool -> AlexAccPred _ -alexPrevCharIsOneOf arr _ input _ _ = arr ! alexInputPrevChar input----alexRightContext :: Int -> AlexAccPred _-alexRightContext (sc) user _ _ input = -     case alex_scan_tkn user input (0) input sc AlexNone of-	  (AlexNone, _) -> False-	  _ -> True-	-- TODO: there's no need to find the longest-	-- match when checking the right context, just-	-- the first match will do.---- used by wrappers-iUnbox (i) = i
− hprotoc/Text/ProtocolBuffers/ProtoCompile/Lexer.x
@@ -1,187 +0,0 @@-{-{-# OPTIONS_GHC -Wwarn #-}-module Text.ProtocolBuffers.ProtoCompile.Lexer (Lexed(..), alexScanTokens,getLinePos)  where--import Control.Monad.Error()-import Codec.Binary.UTF8.String(encode)-import qualified Data.ByteString.Lazy as L-import Data.Char(ord,isHexDigit,isOctDigit,toLower)-import Data.Word(Word8)-import Numeric(readHex,readOct,readDec,readSigned,readFloat)--}--%wrapper "posn-bytestring"--@inComment = ([^\*] | $white)+ | ([\*]+ [^\/])-@comment = [\/] [\*] (@inComment)* [\*]+ [\/] | "//".* | "#".*--$d = [0-9]-@decInt = [\-]?[1-9]$d*-@hexInt = [\-]?0[xX]([A-Fa-f0-9])+-@octInt = [\-]?0[0-7]*-@doubleLit = [\-]?$d+(\.$d+)?([Ee][\+\-]?$d+)?--@ident1 = [A-Za-z_][A-Za-z0-9_]*-@ident = [\.]?@ident1([\.]@ident1)*-@notChar = [^A-Za-z0-9_]--@hexEscape = \\[Xx][A-Fa-f0-9]{1,2}-@octEscape = \\0?[0-7]{1,3}-@charEscape = \\[abfnrtv\\\?'\"]-@inStr = @hexEscape | @octEscape | @charEscape | [^'\"\0\n]-@strLit = ['] (@inStr | [\"])* ['] | [\"] (@inStr | ['])* [\"]--$special    = [=\(\)\,\;\[\]\{\}]--:---  $white+  ;-  @comment ;-  @decInt / @notChar    { parseDec }-  @octInt / @notChar    { parseOct }-  @hexInt / @notChar    { parseHex }-  @doubleLit / @notChar { parseDouble }-  @decInt               { dieAt "decimal followed by invalid character" }-  @octInt               { dieAt "octal followed by invalid character" }-  @hexInt               { dieAt "hex followed by invalid character" }-  @doubleLit            { dieAt "floating followed by invalid character" }-  @strLit               { parseStr }-  @ident                { parseName }-  $special              { parseChar }-  .                     { wtfAt }--{-line :: AlexPosn -> Int-line (AlexPn _byte lineNum _col) = lineNum-{-# INLINE line #-}--data Lexed = L_Integer !Int !Integer-           | L_Double !Int !Double-           | L_Name !Int !L.ByteString-           | L_String !Int !L.ByteString-           | L !Int !Char-           | L_Error !Int !String-  deriving (Show,Eq)--getLinePos :: Lexed -> Int-getLinePos x = case x of-                 L_Integer i _ -> i-                 L_Double  i _ -> i-                 L_Name    i _ -> i-                 L_String  i _ -> i-                 L         i _ -> i-                 L_Error   i _ -> i---- 'errAt' is the only access to L_Error, so I can see where it is created with pos-errAt pos msg =  L_Error (line pos) $ "Lexical error (in Text.ProtocolBuffers.Lexer): "++ msg ++ ", at "++see pos where-  see (AlexPn char lineNum col) = "character "++show char++" line "++show lineNum++" column "++show col++"."-dieAt msg pos _s = errAt pos msg-wtfAt pos s = errAt pos $ "unknown character "++show c++" (decimal "++show (ord c)++")"-  where (c:_) = ByteString.unpack s--{-# INLINE mayRead #-}-mayRead :: ReadS a -> String -> Maybe a-mayRead f s = case f s of [(a,"")] -> Just a; _ -> Nothing---- Given the regexps above, the "parse* failed" messages should be impossible.-parseDec pos s = maybe (errAt pos "Impossible? parseDec failed")-                       (L_Integer (line pos)) $ mayRead (readSigned readDec) (ByteString.unpack s)-parseOct pos s = maybe (errAt pos "Impossible? parseOct failed")-                       (L_Integer (line pos)) $ mayRead (readSigned readOct) (ByteString.unpack s)-parseHex pos s = maybe (errAt pos "Impossible? parseHex failed")-                       (L_Integer (line pos)) $ mayRead (readSigned (readHex . drop 2)) (ByteString.unpack s)-parseDouble pos s = maybe (errAt pos "Impossible? parseDouble failed")-                          (L_Double (line pos)) $ mayRead (readSigned readFloat) (ByteString.unpack s)--- The sDecode of the string contents may fail-parseStr pos s = either (errAt pos) (L_String (line pos) . L.pack) -               . sDecode . ByteString.unpack-               . ByteString.init . ByteString.tail-               $ s-parseName pos s = L_Name (line pos) s-parseChar pos s = L (line pos) (ByteString.head s)---- Generalization of concat . unfoldr to monadic-Either form:-op :: ( [Char] -> Either String (Maybe ([Word8],[Char]))) -> [Char] -> Either String [Word8]-op one = go id where-  go f cs = case one cs of-              Left msg -> Left msg-              Right Nothing -> Right (f [])-              Right (Just (ws,cs')) -> go (f . (ws++)) cs'---- Put this mess in the lexer, so the rest of the code can assume--- everything is saner.  The input is checked to really be "Char8"--- values in the range [0..255] and to be c-escaped (in order to--- render binary information printable).  This decodes the c-escaping--- and returns the binary data as Word8.--- --- A decoding error causes (Left msg) to be returned.-sDecode :: [Char] -> Either String [Word8]-sDecode = op one where-  one :: [Char] -> Either String (Maybe ([Word8],[Char]))-  one ('\\':xs) = unescape xs-  one (x:xs) = do x' <- checkChar8 x-                  return $ Just (x',xs)  -- main case of unescaped value-  one [] = return Nothing-  unescape [] = Left "cannot understand a string that ends with a backslash"-  unescape ys | 1 <= len =-      case mayRead readOct oct of-        Just w -> do w' <- checkByte w-                     return $ Just (w',rest)-        Nothing -> Left $ "failed to decode octal sequence "++ys-    where oct = takeWhile isOctDigit (take 3 ys)-          len = length oct-          rest = drop len ys-  unescape (x:ys) | 'x' == toLower x && 1 <= len =-      case mayRead readHex hex of-        Just w -> do w' <- checkByte w-                     return $ Just (w',rest)-        Nothing -> Left $ "failed to decode hex sequence "++ys-    where hex = takeWhile isHexDigit (take 2 ys)-          len = length hex-          rest = drop len ys          -  unescape ('u':ys) | ok =-      case mayRead readHex hex of-        Just w -> do w' <- checkUnicode w-                     return $ Just (w',rest)-        Nothing -> Left $ "failed to decode 4 char unicode sequence "++ys-    where ok = all isHexDigit hex && 4 == length hex-          (hex,rest) = splitAt 4 ys-  unescape ('U':ys) | ok =-      case mayRead readHex hex of-        Just w -> do w' <- checkUnicode w-                     return $ Just (w',rest)-        Nothing -> Left $ "failed to decode 8 char unicode sequence "++ys-    where ok = all isHexDigit hex && 8 == length hex-          (hex,rest) = splitAt 8 ys-  unescape (x:xs) = do x' <- decode x-                       return $ Just ([x'],xs)-  decode :: Char -> Either String Word8-  decode 'a' = return 7-  decode 'b' = return 8-  decode 't' = return 9-  decode 'n' = return 10-  decode 'v' = return 11-  decode 'f' = return 12-  decode 'r' = return 13-  decode '\"' = return 34-  decode '\'' = return 39-  decode '?' = return 63    -- C99 rule : "\?" is '?'-  decode '\\' = return 92-  decode x | toLower x == 'x' = Left "cannot understand your 'xX' hexadecimal escaped value"-  decode x | toLower x == 'u' = Left "cannot understand your 'uU' unicode UTF-8 hexadecimal escaped value"-  decode _ = Left "cannot understand your backslash-escaped value"-  checkChar8 :: Char -> Either String [Word8]-  checkChar8 c | (0 <= i) && (i <= 255) = Right [toEnum i]-               | otherwise = Left $ "found Char out of range 0..255, value="++show (ord c)-    where i = fromEnum c-  checkByte :: Integer -> Either String [Word8]-  checkByte i | (0 <= i) && (i <= 255) = Right [fromInteger i]-              | otherwise = Left $ "found Oct/Hex Int out of range 0..255, value="++show i-  checkUnicode :: Integer -> Either String [Word8]-  checkUnicode i | (0 <= i) && (i <= 127) = Right [fromInteger i]-                 | i <= maxChar = Right $ encode [ toEnum . fromInteger $ i ]-                 | otherwise = Left $ "found Unicode Char out of range 0..0x10FFFF, value="++show i-    where maxChar = toInteger (fromEnum (maxBound ::Char)) -- 0x10FFFF--}
− hprotoc/Text/ProtocolBuffers/ProtoCompile/MakeReflections.hs
@@ -1,284 +0,0 @@--- | The 'MakeReflections' module takes the 'FileDescriptorProto'--- output from 'Resolve' and produces a 'ProtoInfo' from--- 'Reflections'.  This also takes a Haskell module prefix and the--- proto's package namespace as input.  The output is suitable--- for passing to the 'Gen' module to produce the files.------ This acheives several things: It moves the data from a nested tree--- to flat lists and maps. It moves the group information from the--- parent Descriptor to the actual Descriptor.  It moves the data out--- of Maybe types.  It converts Utf8 to String.  Keys known to extend--- a Descriptor are listed in that Descriptor.--- --- In building the reflection info new things are computed. It changes--- dotted names to ProtoName with the outer prefix.  It parses the--- default value from the ByteString to a Haskell type.  The value of--- the tag on the wire is computed and so is its size on the wire.-module Text.ProtocolBuffers.ProtoCompile.MakeReflections(makeProtoInfo,makeEnumInfo,makeDescriptorInfo,serializeFDP) where--import qualified Text.DescriptorProtos.DescriptorProto                as D(DescriptorProto)-import qualified Text.DescriptorProtos.DescriptorProto                as D.DescriptorProto(DescriptorProto(..))-import qualified Text.DescriptorProtos.DescriptorProto.ExtensionRange as D.DescriptorProto(ExtensionRange(ExtensionRange))-import qualified Text.DescriptorProtos.DescriptorProto.ExtensionRange as D.DescriptorProto.ExtensionRange(ExtensionRange(..))-import qualified Text.DescriptorProtos.EnumDescriptorProto            as D(EnumDescriptorProto) -import qualified Text.DescriptorProtos.EnumDescriptorProto            as D.EnumDescriptorProto(EnumDescriptorProto(..)) -import qualified Text.DescriptorProtos.EnumValueDescriptorProto       as D(EnumValueDescriptorProto)-import qualified Text.DescriptorProtos.EnumValueDescriptorProto       as D.EnumValueDescriptorProto(EnumValueDescriptorProto(..))-import qualified Text.DescriptorProtos.FieldDescriptorProto           as D(FieldDescriptorProto) -import qualified Text.DescriptorProtos.FieldDescriptorProto           as D.FieldDescriptorProto(FieldDescriptorProto(..)) -import qualified Text.DescriptorProtos.FieldDescriptorProto.Label     as D.FieldDescriptorProto(Label)-import           Text.DescriptorProtos.FieldDescriptorProto.Label     as D.FieldDescriptorProto.Label(Label(..))-import qualified Text.DescriptorProtos.FieldDescriptorProto.Type      as D.FieldDescriptorProto(Type)-import           Text.DescriptorProtos.FieldDescriptorProto.Type      as D.FieldDescriptorProto.Type(Type(..))-import qualified Text.DescriptorProtos.FileDescriptorProto            as D(FileDescriptorProto(FileDescriptorProto)) -import qualified Text.DescriptorProtos.FileDescriptorProto            as D.FileDescriptorProto(FileDescriptorProto(..)) --import Text.ProtocolBuffers.Basic-import Text.ProtocolBuffers.Reflections-import Text.ProtocolBuffers.WireMessage(size'Varint,toWireTag,runPut)--import qualified Data.Foldable as F(foldr,toList)-import qualified Data.ByteString as S(concat)-import qualified Data.ByteString.Char8 as SC(spanEnd)-import qualified Data.ByteString.Lazy.Char8 as LC(toChunks,fromChunks,length,init)-import qualified Data.ByteString.Lazy.UTF8 as U(fromString,toString)-import Data.List(partition,unfoldr)-import qualified Data.Sequence as Seq(fromList,empty,singleton)-import Numeric(readHex,readOct,readDec)-import Data.Monoid(mconcat,mappend)-import qualified Data.Map as M(fromListWith,lookup)-import Data.Maybe(fromMaybe,catMaybes)-import System.FilePath----import Debug.Trace (trace)--imp :: String -> a-imp msg = error $ "Text.ProtocolBuffers.ProtoCompile.MakeReflections: Impossible? "++msg--spanEndL :: (Char -> Bool) -> ByteString -> (ByteString, ByteString)-spanEndL f bs = let (a,b) = SC.spanEnd f (S.concat . LC.toChunks $ bs)-                in (LC.fromChunks [a],LC.fromChunks [b])---- Take a bytestring of "A" into "Right A" and "A.B.C" into "Left (A.B,C)"-splitMod :: Utf8 -> Either (Utf8,Utf8) Utf8-splitMod (Utf8 bs) = case spanEndL ('.'/=) bs of-                       (pre,post) | LC.length pre <= 1 -> Right (Utf8 bs)-                                  | otherwise -> Left (Utf8 (LC.init pre),Utf8 post)--toString :: Utf8 -> String-toString = U.toString . utf8--toProtoName :: String -> Utf8 -> ProtoName-toProtoName prefix rawName =-  case splitMod rawName of-    Left (m,b) -> ProtoName prefix (toString m) (toString b)-    Right b    -> ProtoName prefix ""           (toString b)--toPath :: String -> Utf8 -> [FilePath]-toPath prefix name = splitDirectories (combine a b)-  where a = joinPath . splitDot $ prefix-        b = flip addExtension "hs" . joinPath . splitDot . U.toString . utf8 $ name--splitDot :: String -> [FilePath]-splitDot = unfoldr s where-    s ('.':xs) = s xs-    s [] = Nothing-    s xs = Just (span ('.'/=) xs)--pnPath :: ProtoName -> [FilePath]-pnPath (ProtoName a b c) = splitDirectories .flip addExtension "hs" . joinPath . splitDot $ dotPre a (dotPre b c)--dotPre :: String -> String -> String-dotPre "" x = x-dotPre x "" = x-dotPre s x@('.':xs)  | '.' == last s = s ++ xs-                     | otherwise = s ++ x-dotPre s x | '.' == last s = s++x-           | otherwise = s++('.':x)--serializeFDP :: D.FileDescriptorProto -> ByteString-serializeFDP fdp = runPut (wirePut 11 fdp)--makeProtoInfo :: String -> [String] -> D.FileDescriptorProto -> ProtoInfo-makeProtoInfo prefix names-              fdp@(D.FileDescriptorProto-                    { D.FileDescriptorProto.name = Just rawName })-     = ProtoInfo protoName (pnPath protoName) (toString rawName) keyInfos allMessages allEnums allKeys where-  protoName = case names of-                [] -> ProtoName prefix "" ""-                [name] -> ProtoName prefix "" name-                _ -> ProtoName prefix (foldr1 (\a bs -> a  ++ ('.' : bs)) (init names)) (last names)-  keyInfos = Seq.fromList . map (\f -> (keyExtendee prefix f,toFieldInfo protoName f))-             . F.toList . D.FileDescriptorProto.extension $ fdp-  allMessages = concatMap (processMSG False) (F.toList $ D.FileDescriptorProto.message_type fdp)-  allEnums = map (makeEnumInfo prefix) (F.toList $ D.FileDescriptorProto.enum_type fdp) -             ++ concatMap processENM (F.toList $ D.FileDescriptorProto.message_type fdp)-  allKeys = M.fromListWith mappend . map (\(k,a) -> (k,Seq.singleton a))-            . F.toList . mconcat $ keyInfos : map keys allMessages--  processMSG msgIsGroup msg = -    let getKnownKeys protoName' = fromMaybe Seq.empty (M.lookup protoName' allKeys)-        groups = collectedGroups msg-        checkGroup x = elem (fromMaybe (imp $ "no message name in makeProtoInfo.processMSG.checkGroup:\n"++show msg)-                                       (D.DescriptorProto.name x))-                            groups-    in makeDescriptorInfo getKnownKeys prefix msgIsGroup msg-       : concatMap (\x -> processMSG (checkGroup x) x)-                   (F.toList (D.DescriptorProto.nested_type msg))-  processENM msg = foldr ((:) . makeEnumInfo prefix) nested-                         (F.toList (D.DescriptorProto.enum_type msg))-    where nested = concatMap processENM (F.toList (D.DescriptorProto.nested_type msg))-makeProtoInfo prefix names fdp = imp $ "no name in fdp passed to makeProtoInfo: " ++ show (prefix,names,fdp)--collectedGroups :: D.DescriptorProto -> [Utf8] -collectedGroups = catMaybes-                . map D.FieldDescriptorProto.type_name-                . filter (\f -> D.FieldDescriptorProto.type' f == Just TYPE_GROUP) -                . F.toList-                . D.DescriptorProto.field--makeEnumInfo :: String -> D.EnumDescriptorProto -> EnumInfo-makeEnumInfo prefix e@(D.EnumDescriptorProto.EnumDescriptorProto-                        { D.EnumDescriptorProto.name = Just rawName })-    = let protoName = toProtoName prefix rawName-      in EnumInfo protoName (toPath prefix rawName) (enumVals e)-  where enumVals :: D.EnumDescriptorProto -> [(EnumCode,String)]-        enumVals (D.EnumDescriptorProto.EnumDescriptorProto-                    { D.EnumDescriptorProto.value = value}) -            = F.foldr ((:) . oneValue) [] value-          where oneValue  :: D.EnumValueDescriptorProto -> (EnumCode,String)-                oneValue (D.EnumValueDescriptorProto.EnumValueDescriptorProto-                          { D.EnumValueDescriptorProto.name = Just name-                          , D.EnumValueDescriptorProto.number = Just number })-                    = (EnumCode number,toString name)-                oneValue evdp = imp $ "no name or number for evdp passed to makeEnumInfo.oneValue: "++show evdp-makeEnumInfo prefix e = imp $ "no name for enum passed to makeEnumInfo: " ++ show (prefix,e)--makeDescriptorInfo :: (ProtoName -> Seq FieldInfo)-                   -> String -> Bool -> D.DescriptorProto -> DescriptorInfo-makeDescriptorInfo getKnownKeys prefix msgIsGroup-                   (D.DescriptorProto.DescriptorProto-                     { D.DescriptorProto.name = Just rawName-                     , D.DescriptorProto.field = rawFields-                     , D.DescriptorProto.extension_range = extension_range })-    = let di = DescriptorInfo protoName (toPath prefix rawName) msgIsGroup-                              fieldInfos keyInfos extRangeList (getKnownKeys protoName)-      in di -- trace (toString rawName ++ "\n" ++ show di ++ "\n\n") $ di-  where protoName = toProtoName prefix rawName-        (msgFields,keysHere) = partition (\ f -> Nothing == (D.FieldDescriptorProto.extendee f)) . F.toList $ rawFields-        fieldInfos = Seq.fromList . map (toFieldInfo protoName) $ msgFields-        keyInfos = Seq.fromList . map (\f -> (keyExtendee prefix f,toFieldInfo protoName f)) $ keysHere-        extRangeList = concatMap check unchecked-          where check x@(lo,hi) | hi < lo = []-                                | hi<19000 || 19999<lo  = [x]-                                | otherwise = concatMap check [(lo,18999),(20000,hi)]-                unchecked = F.foldr ((:) . extToPair) [] extension_range-                extToPair (D.DescriptorProto.ExtensionRange-                            { D.DescriptorProto.ExtensionRange.start = start-                            , D.DescriptorProto.ExtensionRange.end = end }) =-                  (maybe minBound FieldId start, maybe maxBound FieldId end)-makeDescriptorInfo _ prefix msgIsGroup d =-  imp $ "No name passed in dp passed to makeDescriptorInfo: "++show (prefix,msgIsGroup,d)--  -keyExtendee :: String -> D.FieldDescriptorProto.FieldDescriptorProto -> ProtoName-keyExtendee prefix f-    = case D.FieldDescriptorProto.extendee f of-        Nothing -> error "Impossible? keyExtendee expected Just but found Nothing"-        Just extName -> toProtoName prefix extName--toFieldInfo :: ProtoName ->  D.FieldDescriptorProto -> FieldInfo-toFieldInfo (ProtoName prefix modName parent)-            f@(D.FieldDescriptorProto.FieldDescriptorProto-                { D.FieldDescriptorProto.name = Just name-                , D.FieldDescriptorProto.number = Just number-                , D.FieldDescriptorProto.label = Just label-                , D.FieldDescriptorProto.type' = Just type'-                , D.FieldDescriptorProto.type_name = mayTypeName---                , D.FieldDescriptorProto.extendee = Nothing  -- sanity check-                , D.FieldDescriptorProto.default_value = mayRawDef })-    = fieldInfo-  where mayDef = parseDefaultValue f-        fieldInfo = let fullName = ProtoName prefix (dotPre modName parent) (toString name)-                        fieldId = (FieldId (fromIntegral number))-                        fieldType = (FieldType (fromEnum type'))-                        wt = toWireTag fieldId fieldType-                        wtLength = size'Varint (getWireTag wt)-                    in FieldInfo fullName-                                 fieldId-                                 wt-                                 wtLength-                                 (label == LABEL_REQUIRED)-                                 (label == LABEL_REPEATED)-                                 fieldType-                                 (fmap (toProtoName prefix) mayTypeName)-                                 (fmap utf8 mayRawDef)-                                 mayDef-toFieldInfo pn f = imp $ "Not enough information defined in field passed to toFieldInfo: "++show(pn,f)---- "Nothing" means no value specified--- A failure to parse a provided value will result in an error at the moment-parseDefaultValue :: D.FieldDescriptorProto -> Maybe HsDefault-parseDefaultValue f@(D.FieldDescriptorProto.FieldDescriptorProto-                     { D.FieldDescriptorProto.type' = type'-                     , D.FieldDescriptorProto.default_value = mayRawDef })-    = do bs <- mayRawDef-         t <- type'-         todo <- case t of-                   TYPE_MESSAGE -> Nothing-                   TYPE_GROUP   -> Nothing-                   TYPE_ENUM    -> Just parseDefEnum-                   TYPE_BOOL    -> Just parseDefBool-                   TYPE_BYTES   -> Just parseDefBytes-                   TYPE_DOUBLE  -> Just parseDefDouble-                   TYPE_FLOAT   -> Just parseDefFloat-                   TYPE_STRING  -> Just parseDefString-                   _            -> Just parseDefInteger-         case todo (utf8 bs) of-           Nothing -> error $ "Could not parse as type "++ show t ++"the default value "++ show mayRawDef ++" for field "++show f-           Just value -> return value----- From here down is code used to parse the format of the default values in the .proto files--parseDefEnum :: ByteString -> Maybe HsDefault-parseDefEnum = Just . HsDef'Enum . U.toString--{-# INLINE mayRead #-}-mayRead :: ReadS a -> String -> Maybe a-mayRead f s = case f s of [(a,"")] -> Just a; _ -> Nothing--parseDefDouble :: ByteString -> Maybe HsDefault-parseDefDouble bs = fmap (HsDef'Rational . toRational) -                    . mayRead reads' . U.toString $ bs-  where reads' :: ReadS Double-        reads' = readSigned' reads--parseDefFloat :: ByteString -> Maybe HsDefault-parseDefFloat bs = fmap  (HsDef'Rational . toRational) -                   . mayRead reads' . U.toString $ bs-  where reads' :: ReadS Float-        reads' = readSigned' reads--parseDefString :: ByteString -> Maybe HsDefault-parseDefString bs = Just (HsDef'ByteString bs)--parseDefBytes :: ByteString -> Maybe HsDefault-parseDefBytes bs = Just (HsDef'ByteString bs)--parseDefInteger :: ByteString -> Maybe HsDefault-parseDefInteger bs = fmap HsDef'Integer . mayRead checkSign . U.toString $ bs-    where checkSign = readSigned' checkBase-          checkBase ('0':'x':xs) = readHex xs-          checkBase ('0':xs) = readOct xs-          checkBase xs = readDec xs--parseDefBool :: ByteString -> Maybe HsDefault-parseDefBool bs | bs == U.fromString "true" = Just (HsDef'Bool True)-                | bs == U.fromString "false" = Just (HsDef'Bool False)-                | otherwise = Nothing---- The Numeric.readSigned does not handle '+' for some odd reason-readSigned' :: (Num a) => ([Char] -> [(a, t)]) -> [Char] -> [(a, t)]-readSigned' f ('-':xs) = map (\(v,s) -> (-v,s)) . f $ xs-readSigned' f ('+':xs) = f xs-readSigned' f xs = f xs
− hprotoc/Text/ProtocolBuffers/ProtoCompile/Parser.hs
@@ -1,459 +0,0 @@-module Text.ProtocolBuffers.ProtoCompile.Parser(pbParse,parseProto,filename1,filename2) where--import qualified Text.DescriptorProtos.DescriptorProto                as D(DescriptorProto)-import qualified Text.DescriptorProtos.DescriptorProto                as D.DescriptorProto(DescriptorProto(..))-import qualified Text.DescriptorProtos.DescriptorProto.ExtensionRange as D(ExtensionRange(ExtensionRange))-import qualified Text.DescriptorProtos.DescriptorProto.ExtensionRange as D.ExtensionRange(ExtensionRange(..))-import qualified Text.DescriptorProtos.EnumDescriptorProto            as D(EnumDescriptorProto)-import qualified Text.DescriptorProtos.EnumDescriptorProto            as D.EnumDescriptorProto(EnumDescriptorProto(..))-import qualified Text.DescriptorProtos.EnumValueDescriptorProto       as D(EnumValueDescriptorProto(EnumValueDescriptorProto))-import qualified Text.DescriptorProtos.EnumValueDescriptorProto       as D.EnumValueDescriptorProto(EnumValueDescriptorProto(..))-import qualified Text.DescriptorProtos.FieldDescriptorProto           as D(FieldDescriptorProto(FieldDescriptorProto))-import qualified Text.DescriptorProtos.FieldDescriptorProto           as D.FieldDescriptorProto(FieldDescriptorProto(..))-import qualified Text.DescriptorProtos.FieldDescriptorProto.Type      as D.FieldDescriptorProto(Type)-import           Text.DescriptorProtos.FieldDescriptorProto.Type      as D.FieldDescriptorProto.Type(Type(..))-import qualified Text.DescriptorProtos.FieldOptions                   as D(FieldOptions)-import qualified Text.DescriptorProtos.FieldOptions                   as D.FieldOptions(FieldOptions(..))-import qualified Text.DescriptorProtos.FileDescriptorProto            as D(FileDescriptorProto)-import qualified Text.DescriptorProtos.FileDescriptorProto            as D.FileDescriptorProto(FileDescriptorProto(..))-import qualified Text.DescriptorProtos.FileOptions                    as D.FileOptions(FileOptions(..))-import qualified Text.DescriptorProtos.MessageOptions                 as D.MessageOptions(MessageOptions(..))-import qualified Text.DescriptorProtos.MethodDescriptorProto          as D(MethodDescriptorProto(MethodDescriptorProto))-import qualified Text.DescriptorProtos.MethodDescriptorProto          as D.MethodDescriptorProto(MethodDescriptorProto(..))-import qualified Text.DescriptorProtos.ServiceDescriptorProto         as D.ServiceDescriptorProto(ServiceDescriptorProto(..))--import Text.ProtocolBuffers.Basic-import Text.ProtocolBuffers.Header(ByteString,Int32,Int64,Word32,Word64-                                  ,mergeEmpty,ReflectEnum(reflectEnumInfo),enumName)--import Text.ProtocolBuffers.ProtoCompile.Lexer(Lexed(..),alexScanTokens,getLinePos)-import Text.ProtocolBuffers.ProtoCompile.Instances(parseLabel,parseType)--import Control.Monad(when,liftM3)-import qualified Data.ByteString.Lazy as L(unpack)-import qualified Data.ByteString.Lazy.Char8 as LC(notElem,head,readFile)-import qualified Data.ByteString.Lazy.UTF8 as U(fromString,toString,uncons)-import Data.Char(isUpper)-import Data.Ix(inRange)-import Data.Maybe(fromMaybe)-import Data.Sequence((|>))-import Text.ParserCombinators.Parsec(GenParser,ParseError,runParser,sourceName-                                    ,getInput,setInput,getPosition,setPosition,getState,setState-                                    ,(<?>),(<|>),option,token,choice,between,eof,unexpected,skipMany)-import Text.ParserCombinators.Parsec.Pos(newPos)-import Data.Word(Word8)--default ()--type P = GenParser Lexed--pbParse :: String -> IO (Either ParseError D.FileDescriptorProto)-pbParse filename = fmap (parseProto filename) (LC.readFile filename)--parseProto :: String -> ByteString -> Either ParseError D.FileDescriptorProto-parseProto filename file = do-  let lexed = alexScanTokens file-      ipos = case lexed of-               [] -> setPosition (newPos filename 0 0)-               (l:_) -> setPosition (newPos filename (getLinePos l) 0)-  runParser (ipos >> parser) (initState filename) filename lexed--filename1,filename2 :: String-filename1 = "/tmp/unittest.proto"-filename2 = "/tmp/descriptor.proto"--utf8FromString :: String -> Maybe Utf8-utf8FromString = Just . Utf8 . U.fromString-utf8ToString :: Utf8 -> String-utf8ToString = U.toString . utf8--initState :: String -> D.FileDescriptorProto-initState filename = mergeEmpty {D.FileDescriptorProto.name=utf8FromString filename}--{-# INLINE mayRead #-}-mayRead :: ReadS a -> String -> Maybe a-mayRead f s = case f s of [(a,"")] -> Just a; _ -> Nothing--true,false :: ByteString-true = U.fromString "true"-false = U.fromString "false"---- Use 'token' via 'tok' to make all the parsers for the Lexed values-tok :: (Lexed -> Maybe a) -> P s a-tok f = token show (\lexed -> newPos "" (getLinePos lexed) 0) f--pChar :: Char -> P s ()-pChar c = tok (\l-> case l of L _ x -> if (x==c) then return () else Nothing-                              _ -> Nothing) <?> ("character "++show c)--eol :: P s ()-eol = pChar ';'--eols :: P s ()-eols = skipMany eol--pName :: ByteString -> P s Utf8-pName name = tok (\l-> case l of L_Name _ x -> if (x==name) then return (Utf8 x) else Nothing-                                 _ -> Nothing) <?> ("name "++show (U.toString name))--bsLit :: P s ByteString-bsLit = tok (\l-> case l of L_String _ x -> return x-                            _ -> Nothing) <?> "quoted bytes literal"--strLit :: P s Utf8-strLit = tok (\l-> case l of L_String _ x -> case isValidUTF8 x of-                                               Nothing -> return (Utf8 x)-                                               Just n -> fail $ "bad utf-8 byte in string literal position # "++show n-                             _ -> fail "quoted string literal (UTF-8)")--intLit :: (Num a) => P s a-intLit = tok (\l-> case l of L_Integer _ x -> return (fromInteger x)-                             _ -> Nothing) <?> "integer literal"--fieldInt :: (Num a) => P s a-fieldInt = tok (\l-> case l of L_Integer _ x | inRange validRange x && not (inRange reservedRange x) -> return (fromInteger x)-                               _ -> Nothing) <?> "field number (from 0 to 2^29-1 and not in 19000 to 19999)"-  where validRange = (0,(2^(29::Int))-1)-        reservedRange = (19000,19999)--enumInt :: (Num a) => P s a-enumInt = tok (\l-> case l of L_Integer _ x | inRange validRange x -> return (fromInteger x)-                              _ -> Nothing) <?> "enum value (from 0 to 2^31-1)"-  where validRange = (0,(2^(31::Int))-1)--doubleLit :: P s Double-doubleLit = tok (\l-> case l of L_Double _ x -> return x-                                L_Integer _ x -> return (fromInteger x)-                                _ -> Nothing) <?> "double (or integer) literal"--ident,ident1,ident_package :: P s Utf8-ident = tok (\l-> case l of L_Name _ x -> return (Utf8 x)-                            _ -> Nothing) <?> "identifier (perhaps dotted)"--ident1 = tok (\l-> case l of L_Name _ x | LC.notElem '.' x -> return (Utf8 x)-                             _ -> Nothing) <?> "identifier (not dotted)"--ident_package = tok (\l-> case l of L_Name _ x | LC.head x /= '.' -> return (Utf8 x)-                                    _ -> Nothing) <?> "package name (no leading dot)"--boolLit :: P s Bool-boolLit = tok (\l-> case l of L_Name _ x | x == true -> return True-                                         | x == false -> return False-                              _ -> Nothing) <?> "boolean literal ('true' or 'false')"--enumLit :: forall s a. (Read a,ReflectEnum a) => P s a -- This is very polymorphic, and with a good error message-enumLit = do-  s <- fmap' utf8ToString ident1-  case mayRead reads s of-    Just x -> return x-    Nothing -> let self = enumName (reflectEnumInfo (undefined :: a))-               in unexpected $ "Enum value not recognized: "++show s++", wanted enum value of type "++show self---- subParser changes the user state. It is a bit of a hack and is used--- to define an interesting style of parsing below.-subParser :: GenParser t sSub a -> sSub -> GenParser t s sSub-subParser doSub inSub = do-  in1 <- getInput-  pos1 <- getPosition-  let out = runParser (setPosition pos1 >> doSub >> getStatus) inSub (sourceName pos1) in1-  case out of Left pe -> fail ("the error message from the nested subParser was:\n"++indent (show pe))-              Right (outSub,in2,pos2) -> setInput in2 >> setPosition pos2 >> return outSub- where getStatus = liftM3 (,,) getState getInput getPosition-       indent = unlines . map (\s -> ' ':' ':s) . lines--{-# INLINE return' #-}-return' :: (Monad m) => a -> m a-return' a = return $! a--{-# INLINE fmap' #-}-fmap' :: (Monad m) => (a->b) -> m a -> m b-fmap' f m = m >>= \a -> seq a (return $! (f a))--type Update s = (s -> s) -> P s ()-update' :: Update s-update' f = getState >>= \s -> setState $! (f s)--parser :: P D.FileDescriptorProto D.FileDescriptorProto -parser = proto >> getState-  where proto = eof <|> (choice [ eol-                                , importFile-                                , package-                                , fileOption-                                , message upTopMsg-                                , enum upTopEnum-                                , extend upTopMsg upTopField-                                , service] >> proto)-        upTopMsg msg = update' (\s -> s {D.FileDescriptorProto.message_type=D.FileDescriptorProto.message_type s |> msg})-        upTopEnum e  = update' (\s -> s {D.FileDescriptorProto.enum_type=D.FileDescriptorProto.enum_type s |> e})-        upTopField f = update' (\s -> s {D.FileDescriptorProto.extension=D.FileDescriptorProto.extension s |> f})--importFile,package,fileOption,service :: P D.FileDescriptorProto.FileDescriptorProto ()-importFile = pName (U.fromString "import") >> strLit >>= \p -> eol >> update' (\s -> s {D.FileDescriptorProto.dependency=(D.FileDescriptorProto.dependency s) |> p})--package = pName (U.fromString "package") >> ident_package >>= \p -> eol >> update' (\s -> s {D.FileDescriptorProto.package=Just p})--pOption :: P s String-pOption = pName (U.fromString "option") >> fmap utf8ToString ident1 >>= \optName -> pChar '=' >> return optName--fileOption = pOption >>= setOption >>= \p -> eol >> update' (\s -> s {D.FileDescriptorProto.options=Just p})-  where-    setOption optName = do-      old <- fmap (maybe mergeEmpty id . D.FileDescriptorProto.options) getState-      case optName of-        "java_package"         -> strLit >>= \p -> return' (old {D.FileOptions.java_package=Just p})-        "java_outer_classname" -> strLit >>= \p -> return' (old {D.FileOptions.java_outer_classname=Just p})-        "java_multiple_files"  -> boolLit >>= \p -> return' (old {D.FileOptions.java_multiple_files=Just p})-        "optimize_for"         -> enumLit >>= \p -> return' (old {D.FileOptions.optimize_for=Just p})-        s -> unexpected $ "option name "++s--message :: (D.DescriptorProto -> P s ()) -> P s ()-message up = pName (U.fromString "message") >> do-  self <- ident1-  up =<< subParser (pChar '{' >> subMessage) (mergeEmpty {D.DescriptorProto.name=Just self})---- subMessage is also used to parse group declarations-subMessage,messageOption,extensions :: P D.DescriptorProto.DescriptorProto ()-subMessage = (pChar '}') <|> (choice [ eol-                                     , field upNestedMsg Nothing >>= upMsgField-                                     , message upNestedMsg-                                     , enum upNestedEnum-                                     , extensions-                                     , extend upNestedMsg upMsgField-                                     , messageOption] >> subMessage)-  where upNestedMsg msg = update' (\s -> s {D.DescriptorProto.nested_type=D.DescriptorProto.nested_type s |> msg})-        upNestedEnum e  = update' (\s -> s {D.DescriptorProto.enum_type=D.DescriptorProto.enum_type s |> e})-        upMsgField f    = update' (\s -> s {D.DescriptorProto.field=D.DescriptorProto.field s |> f})--messageOption = pOption >>= setOption >>= \p -> eol >> update' (\s -> s {D.DescriptorProto.options=Just p}) -  where-    setOption optName = do-      old <- fmap (maybe mergeEmpty id . D.DescriptorProto.options) getState-      case optName of-        "message_set_wire_format" -> boolLit >>= \p -> return' (old {D.MessageOptions.message_set_wire_format=Just p})-        s -> unexpected $ "option name "++s--extend :: (D.DescriptorProto -> P s ()) -> (D.FieldDescriptorProto -> P s ())-       -> P s ()-extend upGroup upField = pName (U.fromString "extend") >> do-  typeExtendee <- ident-  pChar '{'-  let rest = (field upGroup (Just typeExtendee) >>= upField) >> eols >> (pChar '}' <|> rest)-  eols >> rest--{--  let first = (eol >> first) <|> ((field upGroup (Just typeExtendee) >>= upField)  >> rest)-      rest = pChar '}' <|> ((eol <|> (field upGroup (Just typeExtendee) >>= upField)) >> rest)-  pChar '{' >> first--}-  -field :: (D.DescriptorProto -> P s ()) -> Maybe Utf8-      -> P s D.FieldDescriptorProto-field upGroup maybeExtendee = do -  let allowedLabels = case maybeExtendee of-                        Nothing -> ["optional","repeated","required"]-                        Just {} -> ["optional","repeated"] -- cannot declare a required extension-  sLabel <- choice . map (pName . U.fromString) $ allowedLabels-  theLabel <- maybe (fail ("not a valid Label :"++show sLabel)) return (parseLabel (utf8ToString sLabel))-  sType <- ident-  let (maybeTypeCode,maybeTypeName) = case parseType (utf8ToString sType) of-                                        Just t -> (Just t,Nothing)-                                        Nothing -> (Nothing, Just sType)-  name <- ident1-  let first = fromMaybe (error "Impossible: ident1 for field name was empty") . fmap fst $ U.uncons (utf8 name)-  number <- pChar '=' >> fieldInt-  (maybeOptions,maybeDefault) <--    if maybeTypeCode == Just TYPE_GROUP-      then do when (not (isUpper first))-                   (fail $ "Group names must start with an upper case letter: "++show name)-              upGroup =<< subParser (pChar '{' >> subMessage) (mergeEmpty {D.DescriptorProto.name=Just name})-              return (Nothing,Nothing)-      else do hasBracket <- option False (pChar '[' >> return True)-              pair <- if not hasBracket then return (Nothing,Nothing)-                        else subParser (subBracketOptions maybeTypeCode) (Nothing,Nothing)-              eol-              return pair-  return $ D.FieldDescriptorProto-               { D.FieldDescriptorProto.name = Just name-               , D.FieldDescriptorProto.number = Just number-               , D.FieldDescriptorProto.label = Just theLabel-               , D.FieldDescriptorProto.type' = maybeTypeCode-               , D.FieldDescriptorProto.type_name = maybeTypeName-               , D.FieldDescriptorProto.extendee = maybeExtendee-               , D.FieldDescriptorProto.default_value = fmap Utf8 maybeDefault -- XXX Hack: we lie about Utf8 for the default value-               , D.FieldDescriptorProto.options = maybeOptions-               }--subBracketOptions :: Maybe Type-                  -> P (Maybe D.FieldOptions, Maybe ByteString) ()-subBracketOptions mt = (defaultConstant <|> fieldOptions) >> (pChar ']' <|> (pChar ',' >> subBracketOptions mt))-  where defaultConstant = do-          pName (U.fromString "default")-          x <- pChar '=' >> constant mt-          (a,_) <- getState-          setState $! (a,Just x)-        fieldOptions = do-          optName <- fmap utf8ToString ident1-          pChar '='-          (mOld,def) <- getState-          let old = maybe mergeEmpty id mOld-          case optName of-            "ctype" | (Just TYPE_STRING) == mt -> do-              enumLit >>= \p -> let new = old {D.FieldOptions.ctype=Just p}-                                in seq new $ setState $! (Just new,def)-            "experimental_map_key" | Nothing == mt -> do-              strLit >>= \p -> let new = old {D.FieldOptions.experimental_map_key=Just p}-                               in seq new $ setState $! (Just new,def)-            s -> unexpected $ "option name: "++s---- This does a type and range safe parsing of the default value,--- except for enum constants which cannot be checked (the definition--- may not have been parsed yet).------ Double and Float are checked to be not-Nan and not-Inf.  The--- int-like types are checked to be within the corresponding range.-constant :: Maybe Type -> P s ByteString-constant Nothing = fmap utf8 ident1 -- hopefully a matching enum; forget about Utf8-constant (Just t) =-  case t of-    TYPE_DOUBLE  -> do d <- doubleLit-                       when (isNaN d || isInfinite d)-                            (fail $ "default floating point literal "++show d++" is out of range for type "++show t)-                       return' (U.fromString . show $ d)-    TYPE_FLOAT   -> do d <- doubleLit-                       let fl :: Float-                           fl = read (show d)-                       when (isNaN fl || isInfinite fl || (d==0) /= (fl==0))-                            (fail $ "default floating point literal "++show d++" is out of range for type "++show t)-                       return' (U.fromString . show $ d)-    TYPE_BOOL    -> boolLit >>= \b -> return' $ if b then true else false-    TYPE_STRING  -> bsLit >>= \s -> maybe (return s) -                                          (\n -> fail $ "default string literal is invalid UTF-8 at byte # "++show n)-                                          (isValidUTF8 s)-    TYPE_BYTES   -> bsLit-    TYPE_GROUP   -> unexpected $ "cannot have a default literal for type "++show t-    TYPE_MESSAGE -> unexpected $ "cannot have a default literal for type "++show t-    TYPE_ENUM    -> fmap utf8 ident1 -- IMPOSSIBLE : SHOULD HAVE HAD Maybe Type PARAMETER match Nothing-    TYPE_SFIXED32 -> f (undefined :: Int32)-    TYPE_SINT32   -> f (undefined :: Int32)-    TYPE_INT32    -> f (undefined :: Int32)-    TYPE_SFIXED64 -> f (undefined :: Int64)-    TYPE_SINT64   -> f (undefined :: Int64)-    TYPE_INT64    -> f (undefined :: Int64)-    TYPE_FIXED32  -> f (undefined :: Word32)-    TYPE_UINT32   -> f (undefined :: Word32)-    TYPE_FIXED64  -> f (undefined :: Word64)-    TYPE_UINT64   -> f (undefined :: Word64)-  where f :: (Bounded a,Integral a) => a -> P s ByteString-        f u = do let range = (toInteger (minBound `asTypeOf` u),toInteger (maxBound `asTypeOf` u))-                 i <- intLit-                 when (not (inRange range i))-                      (fail $ "default integer value "++show i++" is out of range for type "++show t)-                 return' (U.fromString . show $ i)---- Returns Nothing if valid, and the position of the error if invalid-isValidUTF8 :: ByteString -> Maybe Int-isValidUTF8 ws = go 0 (L.unpack ws) 0 where-  go :: Int -> [Word8] -> Int -> Maybe Int-  go 0 [] _ = Nothing-  go 0 (x:xs) n | x <= 127 = go 0 xs $! succ n -- binary 01111111-                | x <= 193 = Just n            -- binary 11000001, decodes to <=127, should not be here-                | x <= 223 = go 1 xs $! succ n -- binary 11011111-                | x <= 239 = go 2 xs $! succ n -- binary 11101111-                | x <= 243 = go 3 xs $! succ n -- binary 11110011-                | x == 244 = high xs $! succ n -- binary 11110100-                | otherwise = Just n-  go i (x:xs) n | 128 <= x && x <= 191 = go (pred i) xs $! succ n-  go _ _ n = Just n-  -- leading 3 bits are 100, so next 6 are at most 001111, i.e. 10001111-  high (x:xs) n | 128 <= x && x <= 143 = go 2 xs $! succ n-                | otherwise = Just n-  high [] n = Just n--enum :: (D.EnumDescriptorProto -> P s ()) -> P s ()-enum up = pName (U.fromString "enum") >> do-  self <- ident1-  up =<< subParser (pChar '{' >> subEnum) (mergeEmpty {D.EnumDescriptorProto.name=Just self})--enumOption,subEnum :: P D.EnumDescriptorProto.EnumDescriptorProto ()-enumOption = pOption >>= setOption >>= \p -> eol >> update' (\s -> s {D.EnumDescriptorProto.options=Just p})-  where-    setOption optName = do-      -- old <- fmap (maybe mergeEmpty id . D.EnumDescriptorProto.options) getState-      case optName of-        s -> unexpected $ "There are no options for enumerations (when this parser was written): "++s--subEnum = eols >> rest -  where rest = (enumVal <|> enumOption) >> eols >> (pChar '}' <|> rest)-{--        first = (eol >> first) <|> ((enumVal <|> (pOption >>= setOption)) >> rest)-        rest = pChar '}' <|> ((eol <|> enumVal <|> (pOption >>= setOption)) >> rest)-        setOption = fail "There are no options for enumerations (when this parser was written)"--}-        enumVal :: P D.EnumDescriptorProto ()-        enumVal = do-          name <- ident1-          number <- pChar '=' >> enumInt-          eol-          let v = D.EnumValueDescriptorProto-                       { D.EnumValueDescriptorProto.name = Just name-                       , D.EnumValueDescriptorProto.number = Just number-                       , D.EnumValueDescriptorProto.options = Nothing-                       }-          update' (\s -> s {D.EnumDescriptorProto.value=D.EnumDescriptorProto.value s |> v})--extensions = pName (U.fromString "extensions") >> do-  start <- fmap Just fieldInt-  pName (U.fromString "to")-  end <- (fmap Just fieldInt <|> fmap (const Nothing) (pName (U.fromString "max")))-  let e = D.ExtensionRange-            { D.ExtensionRange.start = start-            , D.ExtensionRange.end = end-            }-  update' (\s -> s {D.DescriptorProto.extension_range=D.DescriptorProto.extension_range s |> e})--service = pName (U.fromString "service") >> do-  name <- ident1-  f <- subParser (pChar '{' >> subRpc) (mergeEmpty {D.ServiceDescriptorProto.name=Just name})-  update' (\s -> s {D.FileDescriptorProto.service=D.FileDescriptorProto.service s |> f})-       - where subRpc = pChar '}' <|> (choice [ eol-                                      , rpc-                                      , pOption >>= setOption-                                      ] >> subRpc)-       rpc = pName (U.fromString "rpc") >> do-               name <- ident1-               input <- between (pChar '(') (pChar ')') ident1-               pName (U.fromString "returns")-               output <- between (pChar '(') (pChar ')') ident1-               eol-               let m = D.MethodDescriptorProto-                         { D.MethodDescriptorProto.name=Just name-                         , D.MethodDescriptorProto.input_type=Just input-                         , D.MethodDescriptorProto.output_type=Just output-                         , D.MethodDescriptorProto.options=Nothing-                         }-               update' (\s -> s {D.ServiceDescriptorProto.method=D.ServiceDescriptorProto.method s |> m})-       setOption optName = do-         -- old <- fmap (maybe mergeEmpty id . D.ServiceDescriptorProto.options) getState-         case optName of-           s -> unexpected $ "There are no options for services (when this parser was written): "++s--{---- see google's stubs/strutil.cc lines 398-449/1121 and C99 specification--- This mainly targets three digit octal codes-cEncode :: [Word8] -> [Char]-cEncode = concatMap one where-  one :: Word8 -> [Char]-  one x | (32 <= x) && (x < 127) = [toEnum .  fromEnum $  x]  -- main case of unescaped value-  one 9 = sl  't'-  one 10 = sl 'n'-  one 13 = sl 'r'-  one 34 = sl '"'-  one 39 = sl '\''-  one 92 = sl '\\'-  one 0 = '\\':"000"-  one x | x < 8 = '\\':'0':'0':(showOct x "")-        | x < 64 = '\\':'0':(showOct x "")-        | otherwise = '\\':(showOct x "")-  sl c = ['\\',c]--}
− hprotoc/Text/ProtocolBuffers/ProtoCompile/Resolve.hs
@@ -1,354 +0,0 @@--- | Text.ProtocolBuffers.Resolve takes the output of Text.ProtocolBuffers.Parse and runs all--- the preprocessing and sanity checks that precede Text.ProtocolBuffers.Gen creating modules.------ Currently this involves mangling the names, building a NameSpace (or [NameSpace]), and making--- all the names fully qualified (and setting TYPE_MESSAGE or TYPE_ENUM) as appropriate.--- Field names are also checked against a list of reserved words, appending a single quote--- to disambiguate.--- All names from Parser should start with a letter, but _ is also handled by replacing with U' or u'.--- Anything else will trigger a "subborn ..." error.--- Name resolution failure are not handled elegantly: it will kill the system with a long error message.------ TODO: treat names with leading "." as already "fully-qualified"---       make sure the optional fields that will be needed are not Nothing (or punt to Reflections.hs)---       look for repeated use of the same name (before and after mangling)-module Text.ProtocolBuffers.ProtoCompile.Resolve(loadProto,resolveFDP) where--import qualified Text.DescriptorProtos.DescriptorProto                as D(DescriptorProto)-import qualified Text.DescriptorProtos.DescriptorProto                as D.DescriptorProto(DescriptorProto(..))-import qualified Text.DescriptorProtos.DescriptorProto.ExtensionRange as D(ExtensionRange(ExtensionRange))-import qualified Text.DescriptorProtos.DescriptorProto.ExtensionRange as D.ExtensionRange(ExtensionRange(..))-import qualified Text.DescriptorProtos.EnumDescriptorProto            as D(EnumDescriptorProto)-import qualified Text.DescriptorProtos.EnumDescriptorProto            as D.EnumDescriptorProto(EnumDescriptorProto(..))-import qualified Text.DescriptorProtos.EnumValueDescriptorProto       as D(EnumValueDescriptorProto)-import qualified Text.DescriptorProtos.EnumValueDescriptorProto       as D.EnumValueDescriptorProto(EnumValueDescriptorProto(..))-import qualified Text.DescriptorProtos.FieldDescriptorProto           as D.FieldDescriptorProto(FieldDescriptorProto(..))-import qualified Text.DescriptorProtos.FieldDescriptorProto.Type      as D.FieldDescriptorProto(Type)-import           Text.DescriptorProtos.FieldDescriptorProto.Type      as D.FieldDescriptorProto.Type(Type(..))-import qualified Text.DescriptorProtos.FileDescriptorProto            as D(FileDescriptorProto(FileDescriptorProto))-import qualified Text.DescriptorProtos.FileDescriptorProto            as D.FileDescriptorProto(FileDescriptorProto(..))-import qualified Text.DescriptorProtos.FileOptions                    as D.FileOptions(FileOptions(..))-import qualified Text.DescriptorProtos.MethodDescriptorProto          as D(MethodDescriptorProto)-import qualified Text.DescriptorProtos.MethodDescriptorProto          as D.MethodDescriptorProto(MethodDescriptorProto(..))-import qualified Text.DescriptorProtos.ServiceDescriptorProto         as D.ServiceDescriptorProto(ServiceDescriptorProto(..))--import Text.ProtocolBuffers.Header-import Text.ProtocolBuffers.ProtoCompile.Parser--import Control.Monad.State-import Data.Char-import Data.Ix(inRange)-import qualified Data.Foldable as F-import qualified Data.Set as Set-import Data.Maybe(fromMaybe,catMaybes)-import Data.Monoid(Monoid(..))-import Data.Map(Map)-import qualified Data.Map as M-import Data.List(unfoldr,span,inits,foldl')-import qualified Data.ByteString.Lazy.UTF8 as U-import qualified Data.ByteString.Lazy.Char8 as LC-import System.Directory-import System.FilePath--err :: forall b. String -> b-err s = error $ "Text.ProtocolBuffers.Resolve fatal error encountered, message:\n"++indent s-  where indent = unlines . map (\str -> ' ':' ':str) . lines--encodeModuleNames :: [String] -> Utf8-encodeModuleNames [] = Utf8 mempty-encodeModuleNames xs = Utf8 . U.fromString . foldr1 (\a b -> a ++ '.':b) $ xs--mangleCap :: Maybe Utf8 -> [String]-mangleCap = mangleModuleNames . fromMaybe (Utf8 mempty)-  where mangleModuleNames :: Utf8 -> [String]-        mangleModuleNames bs = map mangleModuleName . splitDot . toString $ bs-        splitDot :: String -> [String]-        splitDot = unfoldr s where-          s ('.':xs) = s xs-          s [] = Nothing-          s xs = Just (span ('.'/=) xs)--mangleCap1 :: Maybe Utf8 -> String-mangleCap1 Nothing = ""-mangleCap1 (Just u) = mangleModuleName . toString $ u--mangleEnums :: Seq D.EnumValueDescriptorProto -> Seq D.EnumValueDescriptorProto-mangleEnums s =  fmap fixEnum s-  where fixEnum v = v { D.EnumValueDescriptorProto.name = mangleEnum (D.EnumValueDescriptorProto.name v)}--mangleEnum :: Maybe Utf8 -> Maybe Utf8-mangleEnum = fmap (Utf8 . U.fromString . mangleModuleName . toString)--mangleModuleName :: String -> String-mangleModuleName [] = "Empty'Name" -- XXX-mangleModuleName ('_':xs) = "U'"++xs-mangleModuleName (x:xs) | isLower x = let x' = toUpper x-                                      in if isLower x' then err ("subborn lower case"++show (x:xs))-                                           else x': xs-mangleModuleName xs = xs--mangleFieldName :: Maybe Utf8 -> Maybe Utf8-mangleFieldName = fmap (Utf8 . U.fromString . fixname . toString)-  where fixname [] = "empty'name" -- XXX-        fixname ('_':xs) = "u'"++xs-        fixname (x:xs) | isUpper x = let x' = toLower x-                                     in if isUpper x' then err ("stubborn upper case: "++show (x:xs))-                                          else fixname (x':xs)-        fixname xs | xs `elem` reserved = xs ++ "'"-        fixname xs = xs-        reserved :: [String]-        reserved = ["case","class","data","default","deriving","do","else","foreign"-                   ,"if","import","in","infix","infixl","infixr","instance"-                   ,"let","module","newtype","of","then","type","where"] -- also reserved is "_"--checkER :: [(Int32,Int32)] -> Int32 -> Bool-checkER ers fid = any (`inRange` fid) ers--extRangeList :: D.DescriptorProto -> [(Int32,Int32)]-extRangeList d = concatMap check unchecked-  where check x@(lo,hi) | hi < lo = []-                        | hi<19000 || 19999<lo  = [x]-                        | otherwise = concatMap check [(lo,18999),(20000,hi)]-        unchecked = F.foldr ((:) . extToPair) [] (D.DescriptorProto.extension_range d)-        extToPair (D.ExtensionRange-                    { D.ExtensionRange.start = start-                    , D.ExtensionRange.end = end }) =-          (getFieldId $ maybe minBound FieldId start, getFieldId $ maybe maxBound FieldId end)--newtype NameSpace = NameSpace {unNameSpace::(Map String ([String],NameType,Maybe NameSpace))}-  deriving (Show,Read)-data NameType = Message [(Int32,Int32)] | Enumeration [Utf8] | Service | Void -  deriving (Show,Read)--type Context = [NameSpace]--seeContext :: Context -> [String] -seeContext cx = map ((++"[]") . concatMap (\k -> show k ++ ", ") . M.keys . unNameSpace) cx--toString :: Utf8 -> String-toString = U.toString . utf8--findFile :: [FilePath] -> FilePath -> IO (Maybe FilePath)-findFile paths target = do-  let test [] = return Nothing-      test (path:rest) = do-        let fullname = combine path target-        found <- doesFileExist fullname-        if found then return (Just fullname)-          else test rest-  test paths---- loadProto is a slight kludge.  It takes a single search directory--- and an initial .proto file path relative to this directory.  It--- loads this file and then chases the imports.  If an import loop is--- detected then it aborts.  A state monad is used to memorize--- previous invocations of 'load'.  A progress message of the filepath--- is printed before reading a new .proto file.------ The "contexts" collected and used to "resolveWithContext" can--- contain duplicates: File A imports B and C, and File B imports C--- will cause the context for C to be included twice in contexts.------ The result type of loadProto is enough for now, but may be changed--- in the future.  It returns a map from the files (relative to the--- search directory) to a pair of the resolved descriptor and a set of--- directly imported files.  The dependency tree is thus implicit.-loadProto :: [FilePath] -> FilePath -> IO (Map FilePath (D.FileDescriptorProto,Set.Set FilePath,[String]))-loadProto protoDirs protoFile = fmap answer $ execStateT (load Set.empty protoFile) mempty where-  answer built = fmap snd built -- drop the fst Context from the pair in the memorized map-  loadFailed f msg = fail . unlines $ ["Parsing proto:",f,"has failed with message",msg]-  load :: Set.Set FilePath  -- set of "parents" that is used by load to detect an import loop. Not memorized.-       -> FilePath          -- the FilePath to load and resolve (may used memorized result of load)-       -> StateT (Map FilePath (Context,(D.FileDescriptorProto,Set.Set FilePath,[String]))) -- memorized results of load-                 IO (Context  -- Only used during load. This is the view of the file as an imported namespace.-                    ,(D.FileDescriptorProto  -- This is the resolved version of the FileDescriptorProto-                     ,Set.Set FilePath-                     ,[String]))  -- This is the list of file directly imported by the FilePath argument-  load parentsIn file = do-    built <- get -- to check memorized results-    when (Set.member file parentsIn)-         (loadFailed file (unlines ["imports failed: recursive loop detected"-                                   ,unlines . map show . M.assocs $ built,show parentsIn]))-    let parents = Set.insert file parentsIn-    case M.lookup file built of-      Just result -> return result-      Nothing -> do-        mayToRead <- liftIO $ findFile protoDirs file-        when (Nothing == mayToRead) $-           loadFailed file (unlines (["loading failed, could not find file: "++show file-                                     ,"Searched paths were:"] ++ map ("  "++) protoDirs))-        let (Just toRead) = mayToRead-        proto <- liftIO $ do print ("Loading filepath: "++toRead)-                             LC.readFile toRead-        parsed <- either (loadFailed toRead . show) return (parseProto toRead proto)-        let (context,imports,names) = toContext parsed-        contexts <- fmap (concatMap fst)    -- keep only the fst Context's-                    . mapM (load parents)   -- recursively chase imports-                    . Set.toList $ imports-        let result = ( withPackage context parsed ++ contexts-                     , ( resolveWithContext (context++contexts) parsed-                       , imports-                       , names ) )-        -- add to memorized results, the "load" above may have updated/invalidated the "built <- get" state above-        modify (\built' -> M.insert file result built')-        return result---- Imported names must be fully qualified in the .proto file by the--- target's package name, but the resolved name might be fully--- quilified by something else (e.g. one of the java options).-withPackage :: Context -> D.FileDescriptorProto -> Context-withPackage (cx:_) (D.FileDescriptorProto {D.FileDescriptorProto.package=Just package}) =-  let prepend = mangleCap1 . Just $ package-  in [NameSpace (M.singleton prepend ([prepend],Void,Just cx))]-withPackage (_:_) (D.FileDescriptorProto {D.FileDescriptorProto.name=n}) =  err $-  "withPackage given an imported FDP without a package declaration: "++show n-withPackage [] (D.FileDescriptorProto {D.FileDescriptorProto.name=n}) =  err $-  "withPackage given an empty context: "++show n--resolveFDP :: D.FileDescriptorProto.FileDescriptorProto-           -> (D.FileDescriptorProto.FileDescriptorProto, [String])-resolveFDP fdpIn =-  let (context,_,names) = toContext fdpIn-  in (resolveWithContext context fdpIn,names)-  --- process to get top level context for FDP and list of its imports-toContext :: D.FileDescriptorProto -> (Context,Set.Set FilePath,[String])-toContext protoIn =-  let prefix :: [String]-      prefix = mangleCap . msum $-                 [ D.FileOptions.java_outer_classname =<< (D.FileDescriptorProto.options protoIn)-                 , D.FileOptions.java_package =<< (D.FileDescriptorProto.options protoIn)-                 , D.FileDescriptorProto.package protoIn]-      -- Make top-most root NameSpace-      nameSpace = fromMaybe (NameSpace mempty) $ foldr addPrefix protoNames $ zip prefix (tail (inits prefix))-        where addPrefix (s1,ss) ns = Just . NameSpace $ M.singleton s1 (ss,Void,ns)-              protoNames | null protoMsgs = Nothing-                         | otherwise = Just . NameSpace . M.fromList $ protoMsgs-                where protoMsgs = F.foldr ((:) . msgNames prefix) protoEnums (D.FileDescriptorProto.message_type protoIn)-                      protoEnums = F.foldr ((:) . enumNames prefix) protoServices (D.FileDescriptorProto.enum_type protoIn)-                      protoServices = F.foldr ((:) . serviceNames prefix) [] (D.FileDescriptorProto.service protoIn)-                      msgNames context dIn =-                        let s1 = mangleCap1 (D.DescriptorProto.name dIn)-                            ss' = context ++ [s1]-                            dNames | null dMsgs = Nothing-                                   | otherwise = Just . NameSpace . M.fromList $ dMsgs-                            dMsgs = F.foldr ((:) . msgNames ss') dEnums (D.DescriptorProto.nested_type dIn)-                            dEnums = F.foldr ((:) . enumNames ss') [] (D.DescriptorProto.enum_type dIn)-                        in ( s1 , (ss',Message (extRangeList dIn),dNames) )-                      enumNames context eIn = -- XXX todo mangle enum names ? No-                        let s1 = mangleCap1 (D.EnumDescriptorProto.name eIn)-                            values :: [Utf8]-                            values = catMaybes $ map D.EnumValueDescriptorProto.name (F.toList (D.EnumDescriptorProto.value eIn))-                        in ( s1 , (context ++ [s1],Enumeration values,Nothing) )-                      serviceNames context sIn =-                        let s1 = mangleCap1 (D.ServiceDescriptorProto.name sIn)-                        in ( s1 , (context ++ [s1],Service,Nothing) )-      -- Context stack for resolving the top level declarations-      protoContext :: Context-      protoContext = foldl' (\nss@(NameSpace ns:_) pre -> case M.lookup pre ns of-                                                            Just (_,Void,Just ns1) -> (ns1:nss)-                                                            _ -> nss) [nameSpace] prefix-  in ( protoContext-     , Set.fromList (map toString (F.toList (D.FileDescriptorProto.dependency protoIn)))-     , prefix-     )--resolveWithContext :: Context -> D.FileDescriptorProto -> D.FileDescriptorProto-resolveWithContext protoContext protoIn =-  let rerr msg = err $ "Failure while resolving file descriptor proto whose name is "-                       ++ maybe "<empty name>" toString (D.FileDescriptorProto.name protoIn)++"\n"-                       ++ msg-      descend :: Context -> Maybe Utf8 -> Context -- XXX todo take away the maybe -      descend cx@(NameSpace n:_) name =-        case M.lookup mangled n of-          Just (_,_,Nothing) -> cx-          Just (_,_,Just ns1) -> ns1:cx-          x -> rerr $ "*** Name resolution failed when descending:\n"++unlines (mangled : show x : "KNOWN NAMES" : seeContext cx)-       where mangled = mangleCap1 name -- XXX empty on nothing?-      descend [] _ = []-      resolve :: Context -> Maybe Utf8 -> Maybe Utf8-      resolve _context Nothing = Nothing-      resolve context (Just bs) = fmap fst (resolveWithNameType context bs)-      resolveWithNameType :: Context -> Utf8 -> Maybe (Utf8,NameType)-      resolveWithNameType context bsIn =-        let nameIn = mangleCap (Just bsIn)-            errMsg = "*** Name resolution failed:\n"-                     ++unlines ["Unmangled name: "++show bsIn-                               ,"Mangled name: "++show nameIn-                               ,"List of known names:"]-                     ++ unlines (seeContext context)-            resolver [] (NameSpace _cx) = rerr $ "Impossible? case in Text.ProtocolBuffers.Resolve.resolveWithNameType.resolver []\n" ++ errMsg-            resolver [name] (NameSpace cx) = case M.lookup name cx of-                                               Nothing -> Nothing-                                               Just (fqName,nameType,_) -> Just (encodeModuleNames fqName,nameType)-            resolver (name:rest) (NameSpace cx) = case M.lookup name cx of-                                                    Nothing -> Nothing-                                                    Just (_,_,Nothing) -> Nothing-                                                    Just (_,_,Just cx') -> resolver rest cx'-        in case msum . map (resolver nameIn) $ context of-             Nothing -> rerr errMsg-             Just x -> Just x-      processFDP fdp = fdp-        { D.FileDescriptorProto.message_type = fmap (processMSG protoContext) (D.FileDescriptorProto.message_type fdp)-        , D.FileDescriptorProto.enum_type    = fmap (processENM protoContext) (D.FileDescriptorProto.enum_type fdp)-        , D.FileDescriptorProto.service      = fmap (processSRV protoContext) (D.FileDescriptorProto.service fdp)-        , D.FileDescriptorProto.extension    = fmap (processFLD protoContext Nothing) (D.FileDescriptorProto.extension fdp) }-      processMSG cx msg = msg-        { D.DescriptorProto.name        = self-        , D.DescriptorProto.field       = fmap (processFLD cx' self) (D.DescriptorProto.field msg)-        , D.DescriptorProto.extension   = fmap (processFLD cx' self) (D.DescriptorProto.extension msg)-        , D.DescriptorProto.nested_type = fmap (processMSG cx') (D.DescriptorProto.nested_type msg)-        , D.DescriptorProto.enum_type   = fmap (processENM cx') (D.DescriptorProto.enum_type msg) }-       where cx' = descend cx (D.DescriptorProto.name msg)-             self = resolve cx (D.DescriptorProto.name msg)-      processFLD cx mp f = f { D.FieldDescriptorProto.name          = mangleFieldName (D.FieldDescriptorProto.name f)-                             , D.FieldDescriptorProto.type'         = new_type'-                             , D.FieldDescriptorProto.type_name     = if new_type' == Just TYPE_GROUP-                                                                        then groupName-                                                                        else fmap fst r2-                             , D.FieldDescriptorProto.default_value = checkEnumDefault-                             , D.FieldDescriptorProto.extendee      = fmap newExt (D.FieldDescriptorProto.extendee f)}-       where newExt :: Utf8 -> Utf8-             newExt orig = let e2 = resolveWithNameType cx orig-                           in case (e2,D.FieldDescriptorProto.number f) of-                                (Just (newName,Message ers),Just fid) ->-                                  if checkER ers fid then newName-                                    else rerr $ "*** Name resolution found an extension field that is out of the allowed extension ranges: "++show f ++ "\n has a number "++ show fid ++" not in one of the valid ranges: " ++ show ers-                                (Just _,_) -> rerr $ "*** Name resolution found wrong type for "++show orig++" : "++show e2-                                (Nothing,Just {}) -> rerr $ "*** Name resolution failed for the extendee: "++show f-                                (_,Nothing) -> rerr $ "*** No field id number for the extension field: "++show f-             r2 = fmap (fromMaybe (rerr $ "*** Name resolution failed for the type_name of extension field: "++show f)-                         . (resolveWithNameType cx))-                       (D.FieldDescriptorProto.type_name f)-             t (Message {}) = TYPE_MESSAGE-             t (Enumeration {}) = TYPE_ENUM-             t _ = rerr $ unlines [ "Problem found: processFLD cannot resolve type_name to Void or Service"-                                  , "  The parent message is "++maybe "<no message>" toString mp-                                  , "  The field name is "++maybe "<no field name>" toString (D.FieldDescriptorProto.name f)]-             new_type' = (D.FieldDescriptorProto.type' f) `mplus` (fmap (t.snd) r2)-             checkEnumDefault = case (D.FieldDescriptorProto.default_value f,fmap snd r2) of-                                  (Just name,Just (Enumeration values)) | name  `elem` values -> mangleEnum (Just name)-                                                                        | otherwise ->-                                      rerr $ unlines ["Problem found: default enumeration value not recognized:"-                                                     ,"  The parent message is "++maybe "<no message>" toString mp-                                                     ,"  field name is "++maybe "" toString (D.FieldDescriptorProto.name f)-                                                     ,"  bad enum name is "++show (toString name)-                                                     ,"  possible enum values are "++show (map toString values)]-                                  (Just def,_) | new_type' == Just TYPE_MESSAGE-                                                 || new_type' == Just TYPE_GROUP ->-                                    rerr $ "Problem found: You set a default value for a MESSAGE or GROUP: "++unlines [show def,show f]-                                  (maybeDef,_) -> maybeDef-  -             groupName = case mp of-                           Nothing -> resolve cx (D.FieldDescriptorProto.name f)-                           Just p -> do n <- D.FieldDescriptorProto.name f-                                        return (Utf8 . U.fromString . (toString p++) . ('.':) . mangleModuleName . toString $ n)--      processENM cx e = e { D.EnumDescriptorProto.name = resolve cx (D.EnumDescriptorProto.name e)-                          , D.EnumDescriptorProto.value = mangleEnums (D.EnumDescriptorProto.value e) }-      processSRV cx s = s { D.ServiceDescriptorProto.name   = resolve cx (D.ServiceDescriptorProto.name s)-                          , D.ServiceDescriptorProto.method = fmap (processMTD cx) (D.ServiceDescriptorProto.method s) }-      processMTD cx m = m { D.MethodDescriptorProto.name        = mangleFieldName (D.MethodDescriptorProto.name m)-                          , D.MethodDescriptorProto.input_type  = resolve cx (D.MethodDescriptorProto.input_type m)-                          , D.MethodDescriptorProto.output_type = resolve cx (D.MethodDescriptorProto.output_type m) }-  in processFDP protoIn
− hprotoc/hprotoc.cabal
@@ -1,60 +0,0 @@-name:           hprotoc--- Synchronize this version number with Text.ProtocolBuffers.ProtocolCompile.version-version:        0.2.9-cabal-version:  >= 1.2-build-type:     Simple-license:        BSD3-license-file:   LICENSE-copyright:      (c) 2008 Christopher Edward Kuklewicz-author:         Christopher Edward Kuklewicz-maintainer:     Chris Kuklewicz <protobuf@personal.mightyreason.com>-stability:      Experimental-homepage:       http://hackage.haskell.org/cgi-bin/hackage-scripts/package/protocol-buffers-package-url:    http://darcs.haskell.org/packages/protocol-buffers2/-synopsis:       Parse Google Protocol Buffer specifications-description:    Parse http://code.google.com/apis/protocolbuffers/docs/proto.html-  and perhaps general haskell code to use them-category:       Text-Tested-With:    GHC ==6.8.3-extra-source-files:--flag small_base-    description: Choose the new smaller, split-up base package.--Executable hprotoc-  Main-Is:         Text/ProtocolBuffers/ProtoCompile.hs-  build-tools:     alex-  ghc-options:     -O2 -Wall-  build-depends:   protocol-buffers == 0.2.9, protocol-buffers-descriptor == 0.2.9-  build-depends:   binary, utf8-string-  build-depends:   parsec, haskell-src-  if flag(small_base)-        build-depends: base >= 3,-                       containers,-                       bytestring,-                       array,-                       filepath,-                       directory,-                       mtl,-                       QuickCheck-  else-        build-depends: base < 3-  other-modules:   Text.ProtocolBuffers.ProtoCompile.Gen-                   Text.ProtocolBuffers.ProtoCompile.Instances-                   Text.ProtocolBuffers.ProtoCompile.Lexer-                   Text.ProtocolBuffers.ProtoCompile.MakeReflections-                   Text.ProtocolBuffers.ProtoCompile.Parser-                   Text.ProtocolBuffers.ProtoCompile.Resolve-  extensions:      DeriveDataTypeable,-                   EmptyDataDecls,-                   FlexibleInstances,-                   GADTs,-                   GeneralizedNewtypeDeriving,-                   MagicHash,-                   PatternGuards,-                   RankNTypes,-                   ScopedTypeVariables,-                   TypeSynonymInstances,-                   MultiParamTypeClasses,-                   FunctionalDependencies-
protocol-buffers.cabal view
@@ -1,5 +1,5 @@ name:           protocol-buffers-version:        0.2.9+version:        0.3.1 cabal-version:  >= 1.2 build-type:     Simple license:        BSD3@@ -30,7 +30,7 @@  Library -- fvia-C is needed on OS X powerPC (G4) with WireMessage.hs to prevent a GHC crash-  ghc-options:  -Wall -O2 -fvia-C+  ghc-options:  -Wall -O2   exposed-modules: Text.ProtocolBuffers                    Text.ProtocolBuffers.Basic                    Text.ProtocolBuffers.Default@@ -39,6 +39,7 @@                    Text.ProtocolBuffers.Header                    Text.ProtocolBuffers.Mergeable                    Text.ProtocolBuffers.Reflections+                   Text.ProtocolBuffers.Unknown                    Text.ProtocolBuffers.WireMessage    if flag(small_base)
− tests/Arb.hs
@@ -1,110 +0,0 @@--- | The "Arb" module defined Arbitrary instances for all the basic types-module Arb where--import Test.QuickCheck-import System.Random-import qualified Data.Sequence as Seq-import qualified Data.ByteString.Lazy as L-import qualified Data.ByteString.Lazy.UTF8 as U-import Text.ProtocolBuffers.Basic-import Data.Word(Word8)--arb :: Gen a -> IO a-arb g = do-   s <- getStdGen-   let (s1,s2) = split s-   setStdGen s1-   let (i,s2') = random s2-   return $ generate i s2' g--integralRandomR :: (Integral a, RandomGen g) => (a,a) -> g -> (a,g)-integralRandomR  (a,b) g =-  case randomR (fromIntegral a :: Integer,fromIntegral b :: Integer) g of-    (x,g) -> (fromIntegral x, g)--minmax :: Bounded a => (a,a)-minmax = (minBound,maxBound)--barb :: (Enum a,Bounded a) => Gen a-barb = elements [minBound..maxBound]--bcoarb :: Enum a => a -> Gen b -> Gen b-bcoarb a = variant ((fromEnum a) `rem` 4)--class ArbCon a x where-  futz :: a -> Gen x--instance ArbCon a a where futz = return--instance (Arbitrary a,ArbCon b x) => ArbCon (a -> b) x where-  futz f = arbitrary >>= futz . f--instance Arbitrary Int32 where-  arbitrary = choose minmax-  coarbitrary n = variant (fromIntegral ((fromIntegral n) `rem` 4))--instance Random Int32 where-  randomR = integralRandomR-  random = randomR minmax--instance Arbitrary Int64 where-  arbitrary = choose minmax-  coarbitrary n = variant (fromIntegral ((fromIntegral n) `rem` 4))--instance Random Int64 where-  randomR = integralRandomR-  random = randomR minmax--instance Arbitrary Word32 where-  arbitrary = choose minmax-  coarbitrary n = variant (fromIntegral ((fromIntegral n) `rem` 4))--instance Random Word32 where-  randomR = integralRandomR-  random = randomR minmax--instance Arbitrary Word64 where-  arbitrary = choose minmax-  coarbitrary n = variant (fromIntegral ((fromIntegral n) `rem` 4))--instance Random Word64 where-  randomR = integralRandomR-  random = randomR minmax--instance Arbitrary Word8 where-  arbitrary = choose minmax-  coarbitrary n = variant (fromIntegral ((fromIntegral n) `rem` 4))--instance Random Word8 where-  randomR = integralRandomR-  random = randomR minmax--instance Arbitrary Char where-  arbitrary = choose minmax-  coarbitrary n = variant (fromIntegral ((fromEnum n) `rem` 4))--instance Arbitrary Utf8 where-  arbitrary = do -    len <- frequency-             [ (3, choose (1,3))-             , (1, return 0) ]-    fmap (Utf8 . U.fromString) (vector len)-  coarbitrary (Utf8 s) = variant (fromIntegral ((L.length s) `rem` 4))--instance Arbitrary L.ByteString where-  arbitrary = do-    len <- frequency-             [ (3, choose (1,3))-             , (1, return 0) ]-    fmap L.pack (vector len)-  coarbitrary s = variant (fromIntegral ((L.length s) `rem` 4))--instance Arbitrary a => Arbitrary (Seq a) where-  arbitrary = do-    len <- frequency-             [ (3, choose (1,3))-             , (1, return 0) ]-    fmap Seq.fromList (vector len)-  coarbitrary s = variant ((Seq.length s) `rem` 4)--
− tests/Arb/UnittestProto.hs
@@ -1,224 +0,0 @@--- everything passes version 0.2.7-module Arb.UnittestProto where--import Arb--import qualified Data.ByteString.Lazy as L-import qualified Data.Foldable as F-import qualified Data.Sequence as Seq-import Numeric-import Test.QuickCheck-import Text.ProtocolBuffers-import Text.ProtocolBuffers.Header(prependMessageSize,putSize)--import Text.ProtocolBuffers.Basic-import Text.ProtocolBuffers.WireMessage-import Text.ProtocolBuffers.Extensions--import Com.Google.Protobuf.Test.ImportEnum(ImportEnum(..))-import Com.Google.Protobuf.Test.ImportMessage(ImportMessage(..))-import UnittestProto.ForeignEnum(ForeignEnum(..))-import UnittestProto.ForeignMessage(ForeignMessage(..))-import UnittestProto.TestAllTypes.NestedEnum(NestedEnum(..))-import UnittestProto.TestAllTypes.NestedMessage(NestedMessage(..))-import UnittestProto.TestAllTypes.OptionalGroup(OptionalGroup(..))-import UnittestProto.TestAllTypes.RepeatedGroup(RepeatedGroup(..))--import UnittestProto.TestAllTypes(TestAllTypes(..))--import UnittestProto-import UnittestProto.TestRequired-import UnittestProto.OptionalGroup_extension (OptionalGroup_extension(..))-import UnittestProto.RepeatedGroup_extension (RepeatedGroup_extension(..))-import UnittestProto.TestAllExtensions (TestAllExtensions(..))--import Debug.Trace(trace)--instance Arbitrary ImportEnum where arbitrary = barb-instance Arbitrary ForeignEnum where arbitrary = barb-instance Arbitrary NestedEnum where arbitrary = barb--instance Arbitrary ImportMessage where arbitrary = futz ImportMessage-instance Arbitrary ForeignMessage where arbitrary = futz ForeignMessage-instance Arbitrary NestedMessage where arbitrary = futz NestedMessage-instance Arbitrary OptionalGroup where arbitrary = futz OptionalGroup-instance Arbitrary RepeatedGroup where arbitrary = futz RepeatedGroup-instance Arbitrary TestAllTypes where arbitrary = futz TestAllTypes--instance Arbitrary TestRequired where arbitrary = futz TestRequired-instance Arbitrary OptionalGroup_extension where arbitrary = futz OptionalGroup_extension-instance Arbitrary RepeatedGroup_extension where arbitrary = futz RepeatedGroup_extension--instance Arbitrary TestAllExtensions where-  arbitrary = F.foldlM (\msg alter -> alter msg) defaultValue (map snd allKeys)---- Test passes up to 100000-prop_SizeCalcTo limit = all prop_SizeCalc [0..limit] where-  prop_SizeCalc i = prependMessageSize i == i + (L.length . runPut . putSize $ i)---- quickCheck : TestAllTypes passes 100-prop_Size1 :: forall msg. (ReflectDescriptor msg, Wire msg) => msg -> Bool-prop_Size1 a =-  let predicted = messageSize a-      written = L.length (messagePut a)-  in if predicted == written then True-       else trace ("Wrong size: "++show(predicted,written)) False---- quickCheck : TestAllTypes passes 100-prop_Size2 :: forall msg. (ReflectDescriptor msg, Wire msg) => msg -> Bool-prop_Size2 a =-  let predicted = messageWithLengthSize a-      written = L.length (messageWithLengthPut a)-  in if predicted == written then True-       else trace ("Wrong size: "++show(predicted,written)) False---- convert with no header-prop_WireArb1 :: (Show a,Eq a,Arbitrary a,ReflectDescriptor a,Wire a) => a -> Bool-prop_WireArb1 a =-   case messageGet (messagePut a) of-     Right (a',b) | L.null b -> if a==a' then True-                                  else trace ("Unequal\n" ++ show a ++ "\n\n" ++show a') False-                  | otherwise -> trace ("Not all input consumed: "++show (L.length b)++"\n"++ show a ++ "\n\n" ++show (L.unpack (messagePut a))) False-     Left msg -> trace msg False--type G x = Either String (x,ByteString)---- main method of serialing messages-prop_WireArb3 :: (Show a,Eq a,Arbitrary a,ReflectDescriptor a,Wire a) => a -> Bool-prop_WireArb3 aIn =-   let unused = aIn==a-       Right (a,_) = messageGet (messagePut aIn) in-   case messageGet (messagePut a) of-     Right (a',b) | L.null b -> if a==a' then True-                                  else trace ("Unequal\n" ++ show a ++ "\n\n" ++show a') False-                  | otherwise -> trace ("Not all input consumed: "++show (L.length b)) False-     Left msg -> trace msg False---- convert with with header-prop_WireArb2 :: (Eq a,Arbitrary a,ReflectDescriptor a,Wire a) => a -> Bool-prop_WireArb2 a =-   case messageWithLengthGet (messageWithLengthPut a) of-     Right (a',b) | L.null b -> if a==a' then True-                                  else trace ("Unequal") False-                  | otherwise -> trace ("Not all input consumed: "++show (L.length b)) False-     Left msg -> trace msg False---- used in allKeys-maybeKey :: Arbitrary v => Key Maybe msg v -> msg -> Gen msg-maybeKey k = \msg -> do-  b <- choose (False,True)-  if b then return msg-    else do-  v <- arbitrary-  return (putExt k (Just v) msg)---- used in allKeys-seqKey :: Arbitrary v => Key Seq msg v -> msg -> Gen msg-seqKey k = \msg -> do-  n <- choose (0,3)-  v <- vector n-  return (putExt k (Seq.fromList v) msg)---- Really push the extension system by creating two new keys here, one--- for Maybe code and one for Seq code testing.-newOptKey :: Key Maybe TestAllExtensions Int32-newOptKey = Key 1000000 15 Nothing--newRepKey :: Key Seq TestAllExtensions Utf8-newRepKey = Key 1000001 9 Nothing---- This is all 70 known for TestAllExtensions plus the two above.--- The String names are currently discarded.-allKeys :: [ ( String , TestAllExtensions -> Gen TestAllExtensions ) ]-allKeys = -  [ ( "newOptKey" , maybeKey newOptKey )-  , ( "newRepKey" , seqKey newRepKey )-  , ( "single" , maybeKey single )-  , ( "multi" , seqKey multi )-  , ( "optional_int32_extension" , maybeKey optional_int32_extension )-  , ( "optional_int64_extension" , maybeKey optional_int64_extension )-  , ( "optional_uint32_extension" , maybeKey optional_uint32_extension )-  , ( "optional_uint64_extension" , maybeKey optional_uint64_extension )-  , ( "optional_sint32_extension" , maybeKey optional_sint32_extension )-  , ( "optional_sint64_extension" , maybeKey optional_sint64_extension )-  , ( "optional_fixed32_extension" , maybeKey optional_fixed32_extension )-  , ( "optional_fixed64_extension" , maybeKey optional_fixed64_extension )-  , ( "optional_sfixed32_extension" , maybeKey optional_sfixed32_extension )-  , ( "optional_sfixed64_extension" , maybeKey optional_sfixed64_extension )-  , ( "optional_float_extension" , maybeKey optional_float_extension )-  , ( "optional_double_extension" , maybeKey optional_double_extension )-  , ( "optional_bool_extension" , maybeKey optional_bool_extension )-  , ( "optional_string_extension" , maybeKey optional_string_extension )-  , ( "optional_bytes_extension" , maybeKey optional_bytes_extension )-  , ( "optionalGroup_extension" , maybeKey optionalGroup_extension )-  , ( "optional_nested_message_extension" , maybeKey optional_nested_message_extension )-  , ( "optional_foreign_message_extension" , maybeKey optional_foreign_message_extension )-  , ( "optional_import_message_extension" , maybeKey optional_import_message_extension )-  , ( "optional_nested_enum_extension" , maybeKey optional_nested_enum_extension )-  , ( "optional_foreign_enum_extension" , maybeKey optional_foreign_enum_extension )-  , ( "optional_import_enum_extension" , maybeKey optional_import_enum_extension )-  , ( "optional_string_piece_extension" , maybeKey optional_string_piece_extension )-  , ( "optional_cord_extension" , maybeKey optional_cord_extension )-  , ( "repeated_int32_extension" , seqKey repeated_int32_extension )-  , ( "repeated_int64_extension" , seqKey repeated_int64_extension )-  , ( "repeated_uint32_extension" , seqKey repeated_uint32_extension )-  , ( "repeated_uint64_extension" , seqKey repeated_uint64_extension )-  , ( "repeated_sint32_extension" , seqKey repeated_sint32_extension )-  , ( "repeated_sint64_extension" , seqKey repeated_sint64_extension )-  , ( "repeated_fixed32_extension" , seqKey repeated_fixed32_extension )-  , ( "repeated_fixed64_extension" , seqKey repeated_fixed64_extension )-  , ( "repeated_sfixed32_extension" , seqKey repeated_sfixed32_extension )-  , ( "repeated_sfixed64_extension" , seqKey repeated_sfixed64_extension )-  , ( "repeated_float_extension" , seqKey repeated_float_extension )-  , ( "repeated_double_extension" , seqKey repeated_double_extension )-  , ( "repeated_bool_extension" , seqKey repeated_bool_extension )-  , ( "repeated_string_extension" , seqKey repeated_string_extension )-  , ( "repeated_bytes_extension" , seqKey repeated_bytes_extension )-  , ( "repeatedGroup_extension" , seqKey repeatedGroup_extension )-  , ( "repeated_nested_message_extension" , seqKey repeated_nested_message_extension )-  , ( "repeated_foreign_message_extension" , seqKey repeated_foreign_message_extension )-  , ( "repeated_import_message_extension" , seqKey repeated_import_message_extension )-  , ( "repeated_nested_enum_extension" , seqKey repeated_nested_enum_extension )-  , ( "repeated_foreign_enum_extension" , seqKey repeated_foreign_enum_extension )-  , ( "repeated_import_enum_extension" , seqKey repeated_import_enum_extension )-  , ( "repeated_string_piece_extension" , seqKey repeated_string_piece_extension )-  , ( "repeated_cord_extension" , seqKey repeated_cord_extension )-  , ( "default_int32_extension" , maybeKey default_int32_extension )-  , ( "default_int64_extension" , maybeKey default_int64_extension )-  , ( "default_uint32_extension" , maybeKey default_uint32_extension )-  , ( "default_uint64_extension" , maybeKey default_uint64_extension )-  , ( "default_sint32_extension" , maybeKey default_sint32_extension )-  , ( "default_sint64_extension" , maybeKey default_sint64_extension )-  , ( "default_fixed32_extension" , maybeKey default_fixed32_extension )-  , ( "default_fixed64_extension" , maybeKey default_fixed64_extension )-  , ( "default_sfixed32_extension" , maybeKey default_sfixed32_extension )-  , ( "default_sfixed64_extension" , maybeKey default_sfixed64_extension )-  , ( "default_float_extension" , maybeKey default_float_extension )-  , ( "default_double_extension" , maybeKey default_double_extension )-  , ( "default_bool_extension" , maybeKey default_bool_extension )-  , ( "default_string_extension" , maybeKey default_string_extension )-  , ( "default_bytes_extension" , maybeKey default_bytes_extension )-  , ( "default_nested_enum_extension" , maybeKey default_nested_enum_extension )-  , ( "default_foreign_enum_extension" , maybeKey default_foreign_enum_extension )-  , ( "default_import_enum_extension" , maybeKey default_import_enum_extension )-  , ( "default_string_piece_extension" , maybeKey default_string_piece_extension )-  , ( "default_cord_extension" , maybeKey default_cord_extension )-  ]--tests_TestAllTypes :: [(String,TestAllTypes -> Bool)]-tests_TestAllTypes =- [ ( "Size1" , prop_Size1 )- , ( "Size2", prop_Size2 )- , ( "WireArb1", prop_WireArb1 )- , ( "WireArb2", prop_WireArb2 )- ]---tests_TestAllExtensions :: [(String,TestAllExtensions -> Bool)]-tests_TestAllExtensions =-  [ ( "Size1" , prop_Size1 )-  , ( "Size2", prop_Size2 )-  , ( "WireArb1", prop_WireArb1 )-  , ( "WireArb2", prop_WireArb2 )-  , ( "WireArb3", prop_WireArb3 ) -  ]
− tests/Main.hs
@@ -1,8 +0,0 @@-module Main where--import Test.QuickCheck-import Arb.UnittestProto--main =  do-  mapM_ (\(name,test) -> putStrLn name >> quickCheck test) tests_TestAllTypes-  mapM_ (\(name,test) -> putStrLn name >> quickCheck test) tests_TestAllExtensions
− tests/UnittestProto/BarRequest.hs
@@ -1,54 +0,0 @@-module UnittestProto.BarRequest (BarRequest(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data BarRequest = BarRequest{}-                deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable BarRequest where-  mergeEmpty = BarRequest-  mergeAppend (BarRequest) (BarRequest) = BarRequest- -instance P'.Default BarRequest where-  defaultValue = BarRequest- -instance P'.Wire BarRequest where-  wireSize ft' self'@(BarRequest)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = 0-  wirePut ft' self'@(BarRequest)-    = 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'.return ()-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> BarRequest) BarRequest where-  getVal m' f' = f' m'- -instance P'.GPB BarRequest- -instance P'.ReflectDescriptor BarRequest where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"BarRequest\"}, descFilePath = [\"UnittestProto\",\"BarRequest.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/BarResponse.hs
@@ -1,54 +0,0 @@-module UnittestProto.BarResponse (BarResponse(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data BarResponse = BarResponse{}-                 deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable BarResponse where-  mergeEmpty = BarResponse-  mergeAppend (BarResponse) (BarResponse) = BarResponse- -instance P'.Default BarResponse where-  defaultValue = BarResponse- -instance P'.Wire BarResponse where-  wireSize ft' self'@(BarResponse)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = 0-  wirePut ft' self'@(BarResponse)-    = 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'.return ()-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> BarResponse) BarResponse where-  getVal m' f' = f' m'- -instance P'.GPB BarResponse- -instance P'.ReflectDescriptor BarResponse where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"BarResponse\"}, descFilePath = [\"UnittestProto\",\"BarResponse.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/FooRequest.hs
@@ -1,54 +0,0 @@-module UnittestProto.FooRequest (FooRequest(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data FooRequest = FooRequest{}-                deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable FooRequest where-  mergeEmpty = FooRequest-  mergeAppend (FooRequest) (FooRequest) = FooRequest- -instance P'.Default FooRequest where-  defaultValue = FooRequest- -instance P'.Wire FooRequest where-  wireSize ft' self'@(FooRequest)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = 0-  wirePut ft' self'@(FooRequest)-    = 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'.return ()-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> FooRequest) FooRequest where-  getVal m' f' = f' m'- -instance P'.GPB FooRequest- -instance P'.ReflectDescriptor FooRequest where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"FooRequest\"}, descFilePath = [\"UnittestProto\",\"FooRequest.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/FooResponse.hs
@@ -1,54 +0,0 @@-module UnittestProto.FooResponse (FooResponse(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data FooResponse = FooResponse{}-                 deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable FooResponse where-  mergeEmpty = FooResponse-  mergeAppend (FooResponse) (FooResponse) = FooResponse- -instance P'.Default FooResponse where-  defaultValue = FooResponse- -instance P'.Wire FooResponse where-  wireSize ft' self'@(FooResponse)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = 0-  wirePut ft' self'@(FooResponse)-    = 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'.return ()-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> FooResponse) FooResponse where-  getVal m' f' = f' m'- -instance P'.GPB FooResponse- -instance P'.ReflectDescriptor FooResponse where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"FooResponse\"}, descFilePath = [\"UnittestProto\",\"FooResponse.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/ForeignEnum.hs
@@ -1,47 +0,0 @@-module UnittestProto.ForeignEnum (ForeignEnum(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data ForeignEnum = FOREIGN_FOO-                 | FOREIGN_BAR-                 | FOREIGN_BAZ-                 deriving (P'.Read, P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable ForeignEnum- -instance P'.Bounded ForeignEnum where-  minBound = FOREIGN_FOO-  maxBound = FOREIGN_BAZ- -instance P'.Default ForeignEnum where-  defaultValue = FOREIGN_FOO- -instance P'.Enum ForeignEnum where-  fromEnum (FOREIGN_FOO) = 4-  fromEnum (FOREIGN_BAR) = 5-  fromEnum (FOREIGN_BAZ) = 6-  toEnum 4 = FOREIGN_FOO-  toEnum 5 = FOREIGN_BAR-  toEnum 6 = FOREIGN_BAZ-  succ (FOREIGN_FOO) = FOREIGN_BAR-  succ (FOREIGN_BAR) = FOREIGN_BAZ-  pred (FOREIGN_BAR) = FOREIGN_FOO-  pred (FOREIGN_BAZ) = FOREIGN_BAR- -instance P'.Wire ForeignEnum where-  wireSize ft' enum = P'.wireSize ft' (P'.fromEnum enum)-  wirePut ft' enum = P'.wirePut ft' (P'.fromEnum enum)-  wireGet 14 = P'.fmap P'.toEnum (P'.wireGet 14)-  wireGet ft' = P'.wireGetErr ft'- -instance P'.GPB ForeignEnum- -instance P'.MessageAPI msg' (msg' -> ForeignEnum) ForeignEnum where-  getVal m' f' = f' m'- -instance P'.ReflectEnum ForeignEnum where-  reflectEnum = [(4, "FOREIGN_FOO", FOREIGN_FOO), (5, "FOREIGN_BAR", FOREIGN_BAR), (6, "FOREIGN_BAZ", FOREIGN_BAZ)]-  reflectEnumInfo _-    = P'.EnumInfo (P'.ProtoName "" "UnittestProto" "ForeignEnum") ["UnittestProto", "ForeignEnum.hs"]-        [(4, "FOREIGN_FOO"), (5, "FOREIGN_BAR"), (6, "FOREIGN_BAZ")]
− tests/UnittestProto/ForeignMessage.hs
@@ -1,55 +0,0 @@-module UnittestProto.ForeignMessage (ForeignMessage(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data ForeignMessage = ForeignMessage{c :: P'.Maybe P'.Int32}-                    deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable ForeignMessage where-  mergeEmpty = ForeignMessage P'.mergeEmpty-  mergeAppend (ForeignMessage x'1) (ForeignMessage y'1) = ForeignMessage (P'.mergeAppend x'1 y'1)- -instance P'.Default ForeignMessage where-  defaultValue = ForeignMessage P'.defaultValue- -instance P'.Wire ForeignMessage where-  wireSize ft' self'@(ForeignMessage x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 5 x'1)-  wirePut ft' self'@(ForeignMessage 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 8 5 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{c = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> ForeignMessage) ForeignMessage where-  getVal m' f' = f' m'- -instance P'.GPB ForeignMessage- -instance P'.ReflectDescriptor ForeignMessage where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignMessage\"}, descFilePath = [\"UnittestProto\",\"ForeignMessage.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.ForeignMessage\", baseName = \"c\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/OptionalGroup_extension.hs
@@ -1,55 +0,0 @@-module UnittestProto.OptionalGroup_extension (OptionalGroup_extension(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'--data OptionalGroup_extension = OptionalGroup_extension{a :: P'.Maybe P'.Int32}-                             deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable OptionalGroup_extension where-  mergeEmpty = OptionalGroup_extension P'.mergeEmpty-  mergeAppend (OptionalGroup_extension x'1) (OptionalGroup_extension y'1) = OptionalGroup_extension (P'.mergeAppend x'1 y'1)- -instance P'.Default OptionalGroup_extension where-  defaultValue = OptionalGroup_extension P'.defaultValue- -instance P'.Wire OptionalGroup_extension where-  wireSize ft' self'@(OptionalGroup_extension x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 2 5 x'1)-  wirePut ft' self'@(OptionalGroup_extension 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 136 5 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              17 -> P'.fmap (\ new'Field -> old'Self{a = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> OptionalGroup_extension) OptionalGroup_extension where-  getVal m' f' = f' m'- -instance P'.GPB OptionalGroup_extension- -instance P'.ReflectDescriptor OptionalGroup_extension where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"OptionalGroup_extension\"}, descFilePath = [\"UnittestProto\",\"OptionalGroup_extension.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.OptionalGroup_extension\", baseName = \"a\"}, fieldNumber = FieldId {getFieldId = 17}, wireTag = WireTag {getWireTag = 136}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/RepeatedGroup_extension.hs
@@ -1,55 +0,0 @@-module UnittestProto.RepeatedGroup_extension (RepeatedGroup_extension(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data RepeatedGroup_extension = RepeatedGroup_extension{a :: P'.Maybe P'.Int32}-                             deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable RepeatedGroup_extension where-  mergeEmpty = RepeatedGroup_extension P'.mergeEmpty-  mergeAppend (RepeatedGroup_extension x'1) (RepeatedGroup_extension y'1) = RepeatedGroup_extension (P'.mergeAppend x'1 y'1)- -instance P'.Default RepeatedGroup_extension where-  defaultValue = RepeatedGroup_extension P'.defaultValue- -instance P'.Wire RepeatedGroup_extension where-  wireSize ft' self'@(RepeatedGroup_extension x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 2 5 x'1)-  wirePut ft' self'@(RepeatedGroup_extension 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 376 5 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              47 -> P'.fmap (\ new'Field -> old'Self{a = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> RepeatedGroup_extension) RepeatedGroup_extension where-  getVal m' f' = f' m'- -instance P'.GPB RepeatedGroup_extension- -instance P'.ReflectDescriptor RepeatedGroup_extension where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"RepeatedGroup_extension\"}, descFilePath = [\"UnittestProto\",\"RepeatedGroup_extension.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.RepeatedGroup_extension\", baseName = \"a\"}, fieldNumber = FieldId {getFieldId = 47}, wireTag = WireTag {getWireTag = 376}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestAllExtensions.hs
@@ -1,149 +0,0 @@-module UnittestProto.TestAllExtensions (TestAllExtensions(..)) where-import Prelude ((+), (<=), (&&), ( || ))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified UnittestProto as UnittestProto-       (default_bool_extension, default_bytes_extension, default_cord_extension, default_double_extension,-        default_fixed32_extension, default_fixed64_extension, default_float_extension, default_foreign_enum_extension,-        default_import_enum_extension, default_int32_extension, default_int64_extension, default_nested_enum_extension,-        default_sfixed32_extension, default_sfixed64_extension, default_sint32_extension, default_sint64_extension,-        default_string_extension, default_string_piece_extension, default_uint32_extension, default_uint64_extension,-        optionalGroup_extension, optional_bool_extension, optional_bytes_extension, optional_cord_extension,-        optional_double_extension, optional_fixed32_extension, optional_fixed64_extension, optional_float_extension,-        optional_foreign_enum_extension, optional_foreign_message_extension, optional_import_enum_extension,-        optional_import_message_extension, optional_int32_extension, optional_int64_extension, optional_nested_enum_extension,-        optional_nested_message_extension, optional_sfixed32_extension, optional_sfixed64_extension, optional_sint32_extension,-        optional_sint64_extension, optional_string_extension, optional_string_piece_extension, optional_uint32_extension,-        optional_uint64_extension, repeatedGroup_extension, repeated_bool_extension, repeated_bytes_extension,-        repeated_cord_extension, repeated_double_extension, repeated_fixed32_extension, repeated_fixed64_extension,-        repeated_float_extension, repeated_foreign_enum_extension, repeated_foreign_message_extension,-        repeated_import_enum_extension, repeated_import_message_extension, repeated_int32_extension, repeated_int64_extension,-        repeated_nested_enum_extension, repeated_nested_message_extension, repeated_sfixed32_extension, repeated_sfixed64_extension,-        repeated_sint32_extension, repeated_sint64_extension, repeated_string_extension, repeated_string_piece_extension,-        repeated_uint32_extension, repeated_uint64_extension)-import qualified UnittestProto.TestRequired as UnittestProto.TestRequired (multi, single)- -data TestAllExtensions = TestAllExtensions{ext'field :: P'.ExtField}-                       deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.ExtendMessage TestAllExtensions where-  getExtField = ext'field-  putExtField e'f msg = msg{ext'field = e'f}-  validExtRanges msg = P'.extRanges (P'.reflectDescriptorInfo msg)- -instance P'.Mergeable TestAllExtensions where-  mergeEmpty = TestAllExtensions P'.mergeEmpty-  mergeAppend (TestAllExtensions x'1) (TestAllExtensions y'1) = TestAllExtensions (P'.mergeAppend x'1 y'1)- -instance P'.Default TestAllExtensions where-  defaultValue = TestAllExtensions P'.defaultValue- -instance P'.Wire TestAllExtensions where-  wireSize ft' self'@(TestAllExtensions x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeExtField x'1)-  wirePut ft' self'@(TestAllExtensions 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'.wirePutExtField x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessageExt update'Self-        11 -> P'.getMessageExt update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1001 -> P'.wireGetKey UnittestProto.TestRequired.multi old'Self-              1000 -> P'.wireGetKey UnittestProto.TestRequired.single old'Self-              85 -> P'.wireGetKey UnittestProto.default_cord_extension old'Self-              84 -> P'.wireGetKey UnittestProto.default_string_piece_extension old'Self-              83 -> P'.wireGetKey UnittestProto.default_import_enum_extension old'Self-              82 -> P'.wireGetKey UnittestProto.default_foreign_enum_extension old'Self-              81 -> P'.wireGetKey UnittestProto.default_nested_enum_extension old'Self-              75 -> P'.wireGetKey UnittestProto.default_bytes_extension old'Self-              74 -> P'.wireGetKey UnittestProto.default_string_extension old'Self-              73 -> P'.wireGetKey UnittestProto.default_bool_extension old'Self-              72 -> P'.wireGetKey UnittestProto.default_double_extension old'Self-              71 -> P'.wireGetKey UnittestProto.default_float_extension old'Self-              70 -> P'.wireGetKey UnittestProto.default_sfixed64_extension old'Self-              69 -> P'.wireGetKey UnittestProto.default_sfixed32_extension old'Self-              68 -> P'.wireGetKey UnittestProto.default_fixed64_extension old'Self-              67 -> P'.wireGetKey UnittestProto.default_fixed32_extension old'Self-              66 -> P'.wireGetKey UnittestProto.default_sint64_extension old'Self-              65 -> P'.wireGetKey UnittestProto.default_sint32_extension old'Self-              64 -> P'.wireGetKey UnittestProto.default_uint64_extension old'Self-              63 -> P'.wireGetKey UnittestProto.default_uint32_extension old'Self-              62 -> P'.wireGetKey UnittestProto.default_int64_extension old'Self-              61 -> P'.wireGetKey UnittestProto.default_int32_extension old'Self-              55 -> P'.wireGetKey UnittestProto.repeated_cord_extension old'Self-              54 -> P'.wireGetKey UnittestProto.repeated_string_piece_extension old'Self-              53 -> P'.wireGetKey UnittestProto.repeated_import_enum_extension old'Self-              52 -> P'.wireGetKey UnittestProto.repeated_foreign_enum_extension old'Self-              51 -> P'.wireGetKey UnittestProto.repeated_nested_enum_extension old'Self-              50 -> P'.wireGetKey UnittestProto.repeated_import_message_extension old'Self-              49 -> P'.wireGetKey UnittestProto.repeated_foreign_message_extension old'Self-              48 -> P'.wireGetKey UnittestProto.repeated_nested_message_extension old'Self-              46 -> P'.wireGetKey UnittestProto.repeatedGroup_extension old'Self-              45 -> P'.wireGetKey UnittestProto.repeated_bytes_extension old'Self-              44 -> P'.wireGetKey UnittestProto.repeated_string_extension old'Self-              43 -> P'.wireGetKey UnittestProto.repeated_bool_extension old'Self-              42 -> P'.wireGetKey UnittestProto.repeated_double_extension old'Self-              41 -> P'.wireGetKey UnittestProto.repeated_float_extension old'Self-              40 -> P'.wireGetKey UnittestProto.repeated_sfixed64_extension old'Self-              39 -> P'.wireGetKey UnittestProto.repeated_sfixed32_extension old'Self-              38 -> P'.wireGetKey UnittestProto.repeated_fixed64_extension old'Self-              37 -> P'.wireGetKey UnittestProto.repeated_fixed32_extension old'Self-              36 -> P'.wireGetKey UnittestProto.repeated_sint64_extension old'Self-              35 -> P'.wireGetKey UnittestProto.repeated_sint32_extension old'Self-              34 -> P'.wireGetKey UnittestProto.repeated_uint64_extension old'Self-              33 -> P'.wireGetKey UnittestProto.repeated_uint32_extension old'Self-              32 -> P'.wireGetKey UnittestProto.repeated_int64_extension old'Self-              31 -> P'.wireGetKey UnittestProto.repeated_int32_extension old'Self-              25 -> P'.wireGetKey UnittestProto.optional_cord_extension old'Self-              24 -> P'.wireGetKey UnittestProto.optional_string_piece_extension old'Self-              23 -> P'.wireGetKey UnittestProto.optional_import_enum_extension old'Self-              22 -> P'.wireGetKey UnittestProto.optional_foreign_enum_extension old'Self-              21 -> P'.wireGetKey UnittestProto.optional_nested_enum_extension old'Self-              20 -> P'.wireGetKey UnittestProto.optional_import_message_extension old'Self-              19 -> P'.wireGetKey UnittestProto.optional_foreign_message_extension old'Self-              18 -> P'.wireGetKey UnittestProto.optional_nested_message_extension old'Self-              16 -> P'.wireGetKey UnittestProto.optionalGroup_extension old'Self-              15 -> P'.wireGetKey UnittestProto.optional_bytes_extension old'Self-              14 -> P'.wireGetKey UnittestProto.optional_string_extension old'Self-              13 -> P'.wireGetKey UnittestProto.optional_bool_extension old'Self-              12 -> P'.wireGetKey UnittestProto.optional_double_extension old'Self-              11 -> P'.wireGetKey UnittestProto.optional_float_extension old'Self-              10 -> P'.wireGetKey UnittestProto.optional_sfixed64_extension old'Self-              9 -> P'.wireGetKey UnittestProto.optional_sfixed32_extension old'Self-              8 -> P'.wireGetKey UnittestProto.optional_fixed64_extension old'Self-              7 -> P'.wireGetKey UnittestProto.optional_fixed32_extension old'Self-              6 -> P'.wireGetKey UnittestProto.optional_sint64_extension old'Self-              5 -> P'.wireGetKey UnittestProto.optional_sint32_extension old'Self-              4 -> P'.wireGetKey UnittestProto.optional_uint64_extension old'Self-              3 -> P'.wireGetKey UnittestProto.optional_uint32_extension old'Self-              2 -> P'.wireGetKey UnittestProto.optional_int64_extension old'Self-              1 -> P'.wireGetKey UnittestProto.optional_int32_extension old'Self-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestAllExtensions) TestAllExtensions where-  getVal m' f' = f' m'- -instance P'.GPB TestAllExtensions- -instance P'.ReflectDescriptor TestAllExtensions where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestAllExtensions\"}, descFilePath = [\"UnittestProto\",\"TestAllExtensions.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [(FieldId {getFieldId = 1},FieldId {getFieldId = 18999}),(FieldId {getFieldId = 20000},FieldId {getFieldId = 536870911})], knownKeys = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"multi\"}, fieldNumber = FieldId {getFieldId = 1001}, wireTag = WireTag {getWireTag = 8010}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestRequired\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"single\"}, fieldNumber = FieldId {getFieldId = 1000}, wireTag = WireTag {getWireTag = 8002}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestRequired\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_cord_extension\"}, fieldNumber = FieldId {getFieldId = 85}, wireTag = WireTag {getWireTag = 682}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Just (Chunk \"123\" Empty), hsDefault = Just (HsDef'ByteString (Chunk \"123\" Empty))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_string_piece_extension\"}, fieldNumber = FieldId {getFieldId = 84}, wireTag = WireTag {getWireTag = 674}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Just (Chunk \"abc\" Empty), hsDefault = Just (HsDef'ByteString (Chunk \"abc\" Empty))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_import_enum_extension\"}, fieldNumber = FieldId {getFieldId = 83}, wireTag = WireTag {getWireTag = 664}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"Com.Google.Protobuf.Test\", baseName = \"ImportEnum\"}), hsRawDefault = Just (Chunk \"IMPORT_BAR\" Empty), hsDefault = Just (HsDef'Enum \"IMPORT_BAR\")},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_foreign_enum_extension\"}, fieldNumber = FieldId {getFieldId = 82}, wireTag = WireTag {getWireTag = 656}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignEnum\"}), hsRawDefault = Just (Chunk \"FOREIGN_BAR\" Empty), hsDefault = Just (HsDef'Enum \"FOREIGN_BAR\")},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_nested_enum_extension\"}, fieldNumber = FieldId {getFieldId = 81}, wireTag = WireTag {getWireTag = 648}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedEnum\"}), hsRawDefault = Just (Chunk \"BAR\" Empty), hsDefault = Just (HsDef'Enum \"BAR\")},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_bytes_extension\"}, fieldNumber = FieldId {getFieldId = 75}, wireTag = WireTag {getWireTag = 602}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Just (Chunk \"world\" Empty), hsDefault = Just (HsDef'ByteString (Chunk \"world\" Empty))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_string_extension\"}, fieldNumber = FieldId {getFieldId = 74}, wireTag = WireTag {getWireTag = 594}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Just (Chunk \"hello\" Empty), hsDefault = Just (HsDef'ByteString (Chunk \"hello\" Empty))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_bool_extension\"}, fieldNumber = FieldId {getFieldId = 73}, wireTag = WireTag {getWireTag = 584}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Just (Chunk \"true\" Empty), hsDefault = Just (HsDef'Bool True)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_double_extension\"}, fieldNumber = FieldId {getFieldId = 72}, wireTag = WireTag {getWireTag = 577}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 1}, typeName = Nothing, hsRawDefault = Just (Chunk \"52000.0\" Empty), hsDefault = Just (HsDef'Rational (52000%1))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_float_extension\"}, fieldNumber = FieldId {getFieldId = 71}, wireTag = WireTag {getWireTag = 573}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 2}, typeName = Nothing, hsRawDefault = Just (Chunk \"51.5\" Empty), hsDefault = Just (HsDef'Rational (103%2))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_sfixed64_extension\"}, fieldNumber = FieldId {getFieldId = 70}, wireTag = WireTag {getWireTag = 561}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 16}, typeName = Nothing, hsRawDefault = Just (Chunk \"-50\" Empty), hsDefault = Just (HsDef'Integer (-50))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_sfixed32_extension\"}, fieldNumber = FieldId {getFieldId = 69}, wireTag = WireTag {getWireTag = 557}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 15}, typeName = Nothing, hsRawDefault = Just (Chunk \"49\" Empty), hsDefault = Just (HsDef'Integer 49)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_fixed64_extension\"}, fieldNumber = FieldId {getFieldId = 68}, wireTag = WireTag {getWireTag = 545}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 6}, typeName = Nothing, hsRawDefault = Just (Chunk \"48\" Empty), hsDefault = Just (HsDef'Integer 48)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_fixed32_extension\"}, fieldNumber = FieldId {getFieldId = 67}, wireTag = WireTag {getWireTag = 541}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 7}, typeName = Nothing, hsRawDefault = Just (Chunk \"47\" Empty), hsDefault = Just (HsDef'Integer 47)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_sint64_extension\"}, fieldNumber = FieldId {getFieldId = 66}, wireTag = WireTag {getWireTag = 529}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 18}, typeName = Nothing, hsRawDefault = Just (Chunk \"46\" Empty), hsDefault = Just (HsDef'Integer 46)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_sint32_extension\"}, fieldNumber = FieldId {getFieldId = 65}, wireTag = WireTag {getWireTag = 525}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 17}, typeName = Nothing, hsRawDefault = Just (Chunk \"-45\" Empty), hsDefault = Just (HsDef'Integer (-45))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_uint64_extension\"}, fieldNumber = FieldId {getFieldId = 64}, wireTag = WireTag {getWireTag = 512}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Just (Chunk \"44\" Empty), hsDefault = Just (HsDef'Integer 44)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_uint32_extension\"}, fieldNumber = FieldId {getFieldId = 63}, wireTag = WireTag {getWireTag = 504}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Just (Chunk \"43\" Empty), hsDefault = Just (HsDef'Integer 43)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_int64_extension\"}, fieldNumber = FieldId {getFieldId = 62}, wireTag = WireTag {getWireTag = 496}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 3}, typeName = Nothing, hsRawDefault = Just (Chunk \"42\" Empty), hsDefault = Just (HsDef'Integer 42)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"default_int32_extension\"}, fieldNumber = FieldId {getFieldId = 61}, wireTag = WireTag {getWireTag = 488}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Just (Chunk \"41\" Empty), hsDefault = Just (HsDef'Integer 41)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_cord_extension\"}, fieldNumber = FieldId {getFieldId = 55}, wireTag = WireTag {getWireTag = 442}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_string_piece_extension\"}, fieldNumber = FieldId {getFieldId = 54}, wireTag = WireTag {getWireTag = 434}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_import_enum_extension\"}, fieldNumber = FieldId {getFieldId = 53}, wireTag = WireTag {getWireTag = 424}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"Com.Google.Protobuf.Test\", baseName = \"ImportEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_foreign_enum_extension\"}, fieldNumber = FieldId {getFieldId = 52}, wireTag = WireTag {getWireTag = 416}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_nested_enum_extension\"}, fieldNumber = FieldId {getFieldId = 51}, wireTag = WireTag {getWireTag = 408}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_import_message_extension\"}, fieldNumber = FieldId {getFieldId = 50}, wireTag = WireTag {getWireTag = 402}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"Com.Google.Protobuf.Test\", baseName = \"ImportMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_foreign_message_extension\"}, fieldNumber = FieldId {getFieldId = 49}, wireTag = WireTag {getWireTag = 394}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_nested_message_extension\"}, fieldNumber = FieldId {getFieldId = 48}, wireTag = WireTag {getWireTag = 386}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeatedGroup_extension\"}, fieldNumber = FieldId {getFieldId = 46}, wireTag = WireTag {getWireTag = 371}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 10}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"RepeatedGroup_extension\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_bytes_extension\"}, fieldNumber = FieldId {getFieldId = 45}, wireTag = WireTag {getWireTag = 362}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_string_extension\"}, fieldNumber = FieldId {getFieldId = 44}, wireTag = WireTag {getWireTag = 354}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_bool_extension\"}, fieldNumber = FieldId {getFieldId = 43}, wireTag = WireTag {getWireTag = 344}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_double_extension\"}, fieldNumber = FieldId {getFieldId = 42}, wireTag = WireTag {getWireTag = 337}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 1}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_float_extension\"}, fieldNumber = FieldId {getFieldId = 41}, wireTag = WireTag {getWireTag = 333}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 2}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_sfixed64_extension\"}, fieldNumber = FieldId {getFieldId = 40}, wireTag = WireTag {getWireTag = 321}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 16}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_sfixed32_extension\"}, fieldNumber = FieldId {getFieldId = 39}, wireTag = WireTag {getWireTag = 317}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 15}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_fixed64_extension\"}, fieldNumber = FieldId {getFieldId = 38}, wireTag = WireTag {getWireTag = 305}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 6}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_fixed32_extension\"}, fieldNumber = FieldId {getFieldId = 37}, wireTag = WireTag {getWireTag = 301}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 7}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_sint64_extension\"}, fieldNumber = FieldId {getFieldId = 36}, wireTag = WireTag {getWireTag = 289}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 18}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_sint32_extension\"}, fieldNumber = FieldId {getFieldId = 35}, wireTag = WireTag {getWireTag = 285}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 17}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_uint64_extension\"}, fieldNumber = FieldId {getFieldId = 34}, wireTag = WireTag {getWireTag = 272}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_uint32_extension\"}, fieldNumber = FieldId {getFieldId = 33}, wireTag = WireTag {getWireTag = 264}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_int64_extension\"}, fieldNumber = FieldId {getFieldId = 32}, wireTag = WireTag {getWireTag = 256}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 3}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"repeated_int32_extension\"}, fieldNumber = FieldId {getFieldId = 31}, wireTag = WireTag {getWireTag = 248}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_cord_extension\"}, fieldNumber = FieldId {getFieldId = 25}, wireTag = WireTag {getWireTag = 202}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_string_piece_extension\"}, fieldNumber = FieldId {getFieldId = 24}, wireTag = WireTag {getWireTag = 194}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_import_enum_extension\"}, fieldNumber = FieldId {getFieldId = 23}, wireTag = WireTag {getWireTag = 184}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"Com.Google.Protobuf.Test\", baseName = \"ImportEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_foreign_enum_extension\"}, fieldNumber = FieldId {getFieldId = 22}, wireTag = WireTag {getWireTag = 176}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_nested_enum_extension\"}, fieldNumber = FieldId {getFieldId = 21}, wireTag = WireTag {getWireTag = 168}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_import_message_extension\"}, fieldNumber = FieldId {getFieldId = 20}, wireTag = WireTag {getWireTag = 162}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"Com.Google.Protobuf.Test\", baseName = \"ImportMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_foreign_message_extension\"}, fieldNumber = FieldId {getFieldId = 19}, wireTag = WireTag {getWireTag = 154}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_nested_message_extension\"}, fieldNumber = FieldId {getFieldId = 18}, wireTag = WireTag {getWireTag = 146}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optionalGroup_extension\"}, fieldNumber = FieldId {getFieldId = 16}, wireTag = WireTag {getWireTag = 131}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 10}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"OptionalGroup_extension\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_bytes_extension\"}, fieldNumber = FieldId {getFieldId = 15}, wireTag = WireTag {getWireTag = 122}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_string_extension\"}, fieldNumber = FieldId {getFieldId = 14}, wireTag = WireTag {getWireTag = 114}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_bool_extension\"}, fieldNumber = FieldId {getFieldId = 13}, wireTag = WireTag {getWireTag = 104}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_double_extension\"}, fieldNumber = FieldId {getFieldId = 12}, wireTag = WireTag {getWireTag = 97}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 1}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_float_extension\"}, fieldNumber = FieldId {getFieldId = 11}, wireTag = WireTag {getWireTag = 93}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 2}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_sfixed64_extension\"}, fieldNumber = FieldId {getFieldId = 10}, wireTag = WireTag {getWireTag = 81}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 16}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_sfixed32_extension\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 77}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 15}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_fixed64_extension\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 65}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 6}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_fixed32_extension\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 61}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 7}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_sint64_extension\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 49}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 18}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_sint32_extension\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 45}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 17}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_uint64_extension\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_uint32_extension\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_int64_extension\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 3}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"optional_int32_extension\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}]}"
− tests/UnittestProto/TestAllTypes.hs
@@ -1,557 +0,0 @@-module UnittestProto.TestAllTypes (TestAllTypes(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified Com.Google.Protobuf.Test.ImportEnum as Com.Google.Protobuf.Test (ImportEnum)-import qualified Com.Google.Protobuf.Test.ImportMessage as Com.Google.Protobuf.Test (ImportMessage)-import qualified UnittestProto.ForeignEnum as UnittestProto (ForeignEnum)-import qualified UnittestProto.ForeignMessage as UnittestProto (ForeignMessage)-import qualified UnittestProto.TestAllTypes.NestedEnum as UnittestProto.TestAllTypes (NestedEnum)-import qualified UnittestProto.TestAllTypes.NestedMessage as UnittestProto.TestAllTypes (NestedMessage)-import qualified UnittestProto.TestAllTypes.OptionalGroup as UnittestProto.TestAllTypes (OptionalGroup)-import qualified UnittestProto.TestAllTypes.RepeatedGroup as UnittestProto.TestAllTypes (RepeatedGroup)- -data TestAllTypes = TestAllTypes{optional_int32 :: P'.Maybe P'.Int32, optional_int64 :: P'.Maybe P'.Int64,-                                 optional_uint32 :: P'.Maybe P'.Word32, optional_uint64 :: P'.Maybe P'.Word64,-                                 optional_sint32 :: P'.Maybe P'.Int32, optional_sint64 :: P'.Maybe P'.Int64,-                                 optional_fixed32 :: P'.Maybe P'.Word32, optional_fixed64 :: P'.Maybe P'.Word64,-                                 optional_sfixed32 :: P'.Maybe P'.Int32, optional_sfixed64 :: P'.Maybe P'.Int64,-                                 optional_float :: P'.Maybe P'.Float, optional_double :: P'.Maybe P'.Double,-                                 optional_bool :: P'.Maybe P'.Bool, optional_string :: P'.Maybe P'.Utf8,-                                 optional_bytes :: P'.Maybe P'.ByteString,-                                 optionalGroup :: P'.Maybe UnittestProto.TestAllTypes.OptionalGroup,-                                 optional_nested_message :: P'.Maybe UnittestProto.TestAllTypes.NestedMessage,-                                 optional_foreign_message :: P'.Maybe UnittestProto.ForeignMessage,-                                 optional_import_message :: P'.Maybe Com.Google.Protobuf.Test.ImportMessage,-                                 optional_nested_enum :: P'.Maybe UnittestProto.TestAllTypes.NestedEnum,-                                 optional_foreign_enum :: P'.Maybe UnittestProto.ForeignEnum,-                                 optional_import_enum :: P'.Maybe Com.Google.Protobuf.Test.ImportEnum,-                                 optional_string_piece :: P'.Maybe P'.Utf8, optional_cord :: P'.Maybe P'.Utf8,-                                 repeated_int32 :: P'.Seq P'.Int32, repeated_int64 :: P'.Seq P'.Int64,-                                 repeated_uint32 :: P'.Seq P'.Word32, repeated_uint64 :: P'.Seq P'.Word64,-                                 repeated_sint32 :: P'.Seq P'.Int32, repeated_sint64 :: P'.Seq P'.Int64,-                                 repeated_fixed32 :: P'.Seq P'.Word32, repeated_fixed64 :: P'.Seq P'.Word64,-                                 repeated_sfixed32 :: P'.Seq P'.Int32, repeated_sfixed64 :: P'.Seq P'.Int64,-                                 repeated_float :: P'.Seq P'.Float, repeated_double :: P'.Seq P'.Double,-                                 repeated_bool :: P'.Seq P'.Bool, repeated_string :: P'.Seq P'.Utf8,-                                 repeated_bytes :: P'.Seq P'.ByteString,-                                 repeatedGroup :: P'.Seq UnittestProto.TestAllTypes.RepeatedGroup,-                                 repeated_nested_message :: P'.Seq UnittestProto.TestAllTypes.NestedMessage,-                                 repeated_foreign_message :: P'.Seq UnittestProto.ForeignMessage,-                                 repeated_import_message :: P'.Seq Com.Google.Protobuf.Test.ImportMessage,-                                 repeated_nested_enum :: P'.Seq UnittestProto.TestAllTypes.NestedEnum,-                                 repeated_foreign_enum :: P'.Seq UnittestProto.ForeignEnum,-                                 repeated_import_enum :: P'.Seq Com.Google.Protobuf.Test.ImportEnum,-                                 repeated_string_piece :: P'.Seq P'.Utf8, repeated_cord :: P'.Seq P'.Utf8,-                                 default_int32 :: P'.Maybe P'.Int32, default_int64 :: P'.Maybe P'.Int64,-                                 default_uint32 :: P'.Maybe P'.Word32, default_uint64 :: P'.Maybe P'.Word64,-                                 default_sint32 :: P'.Maybe P'.Int32, default_sint64 :: P'.Maybe P'.Int64,-                                 default_fixed32 :: P'.Maybe P'.Word32, default_fixed64 :: P'.Maybe P'.Word64,-                                 default_sfixed32 :: P'.Maybe P'.Int32, default_sfixed64 :: P'.Maybe P'.Int64,-                                 default_float :: P'.Maybe P'.Float, default_double :: P'.Maybe P'.Double,-                                 default_bool :: P'.Maybe P'.Bool, default_string :: P'.Maybe P'.Utf8,-                                 default_bytes :: P'.Maybe P'.ByteString,-                                 default_nested_enum :: P'.Maybe UnittestProto.TestAllTypes.NestedEnum,-                                 default_foreign_enum :: P'.Maybe UnittestProto.ForeignEnum,-                                 default_import_enum :: P'.Maybe Com.Google.Protobuf.Test.ImportEnum,-                                 default_string_piece :: P'.Maybe P'.Utf8, default_cord :: P'.Maybe P'.Utf8}-                  deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestAllTypes where-  mergeEmpty-    = TestAllTypes P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-  mergeAppend-    (TestAllTypes x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12 x'13 x'14 x'15 x'16 x'17 x'18 x'19 x'20 x'21 x'22 x'23 x'24-       x'25 x'26 x'27 x'28 x'29 x'30 x'31 x'32 x'33 x'34 x'35 x'36 x'37 x'38 x'39 x'40 x'41 x'42 x'43 x'44 x'45 x'46 x'47 x'48 x'49-       x'50 x'51 x'52 x'53 x'54 x'55 x'56 x'57 x'58 x'59 x'60 x'61 x'62 x'63 x'64 x'65 x'66 x'67 x'68)-    (TestAllTypes y'1 y'2 y'3 y'4 y'5 y'6 y'7 y'8 y'9 y'10 y'11 y'12 y'13 y'14 y'15 y'16 y'17 y'18 y'19 y'20 y'21 y'22 y'23 y'24-       y'25 y'26 y'27 y'28 y'29 y'30 y'31 y'32 y'33 y'34 y'35 y'36 y'37 y'38 y'39 y'40 y'41 y'42 y'43 y'44 y'45 y'46 y'47 y'48 y'49-       y'50 y'51 y'52 y'53 y'54 y'55 y'56 y'57 y'58 y'59 y'60 y'61 y'62 y'63 y'64 y'65 y'66 y'67 y'68)-    = TestAllTypes (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)-        (P'.mergeAppend x'5 y'5)-        (P'.mergeAppend x'6 y'6)-        (P'.mergeAppend x'7 y'7)-        (P'.mergeAppend x'8 y'8)-        (P'.mergeAppend x'9 y'9)-        (P'.mergeAppend x'10 y'10)-        (P'.mergeAppend x'11 y'11)-        (P'.mergeAppend x'12 y'12)-        (P'.mergeAppend x'13 y'13)-        (P'.mergeAppend x'14 y'14)-        (P'.mergeAppend x'15 y'15)-        (P'.mergeAppend x'16 y'16)-        (P'.mergeAppend x'17 y'17)-        (P'.mergeAppend x'18 y'18)-        (P'.mergeAppend x'19 y'19)-        (P'.mergeAppend x'20 y'20)-        (P'.mergeAppend x'21 y'21)-        (P'.mergeAppend x'22 y'22)-        (P'.mergeAppend x'23 y'23)-        (P'.mergeAppend x'24 y'24)-        (P'.mergeAppend x'25 y'25)-        (P'.mergeAppend x'26 y'26)-        (P'.mergeAppend x'27 y'27)-        (P'.mergeAppend x'28 y'28)-        (P'.mergeAppend x'29 y'29)-        (P'.mergeAppend x'30 y'30)-        (P'.mergeAppend x'31 y'31)-        (P'.mergeAppend x'32 y'32)-        (P'.mergeAppend x'33 y'33)-        (P'.mergeAppend x'34 y'34)-        (P'.mergeAppend x'35 y'35)-        (P'.mergeAppend x'36 y'36)-        (P'.mergeAppend x'37 y'37)-        (P'.mergeAppend x'38 y'38)-        (P'.mergeAppend x'39 y'39)-        (P'.mergeAppend x'40 y'40)-        (P'.mergeAppend x'41 y'41)-        (P'.mergeAppend x'42 y'42)-        (P'.mergeAppend x'43 y'43)-        (P'.mergeAppend x'44 y'44)-        (P'.mergeAppend x'45 y'45)-        (P'.mergeAppend x'46 y'46)-        (P'.mergeAppend x'47 y'47)-        (P'.mergeAppend x'48 y'48)-        (P'.mergeAppend x'49 y'49)-        (P'.mergeAppend x'50 y'50)-        (P'.mergeAppend x'51 y'51)-        (P'.mergeAppend x'52 y'52)-        (P'.mergeAppend x'53 y'53)-        (P'.mergeAppend x'54 y'54)-        (P'.mergeAppend x'55 y'55)-        (P'.mergeAppend x'56 y'56)-        (P'.mergeAppend x'57 y'57)-        (P'.mergeAppend x'58 y'58)-        (P'.mergeAppend x'59 y'59)-        (P'.mergeAppend x'60 y'60)-        (P'.mergeAppend x'61 y'61)-        (P'.mergeAppend x'62 y'62)-        (P'.mergeAppend x'63 y'63)-        (P'.mergeAppend x'64 y'64)-        (P'.mergeAppend x'65 y'65)-        (P'.mergeAppend x'66 y'66)-        (P'.mergeAppend x'67 y'67)-        (P'.mergeAppend x'68 y'68)- -instance P'.Default TestAllTypes where-  defaultValue-    = TestAllTypes P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        (P'.Just 41)-        (P'.Just 42)-        (P'.Just 43)-        (P'.Just 44)-        (P'.Just (-45))-        (P'.Just 46)-        (P'.Just 47)-        (P'.Just 48)-        (P'.Just 49)-        (P'.Just (-50))-        (P'.Just 51.5)-        (P'.Just 52000.0)-        (P'.Just P'.True)-        (P'.Just (P'.Utf8 (P'.pack "hello")))-        (P'.Just (P'.pack "world"))-        (P'.Just (P'.read "BAR"))-        (P'.Just (P'.read "FOREIGN_BAR"))-        (P'.Just (P'.read "IMPORT_BAR"))-        (P'.Just (P'.Utf8 (P'.pack "abc")))-        (P'.Just (P'.Utf8 (P'.pack "123")))- -instance P'.Wire TestAllTypes where-  wireSize ft'-    self'@(TestAllTypes x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12 x'13 x'14 x'15 x'16 x'17 x'18 x'19 x'20 x'21 x'22 x'23-             x'24 x'25 x'26 x'27 x'28 x'29 x'30 x'31 x'32 x'33 x'34 x'35 x'36 x'37 x'38 x'39 x'40 x'41 x'42 x'43 x'44 x'45 x'46 x'47-             x'48 x'49 x'50 x'51 x'52 x'53 x'54 x'55 x'56 x'57 x'58 x'59 x'60 x'61 x'62 x'63 x'64 x'65 x'66 x'67 x'68)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size-          = (P'.wireSizeOpt 1 5 x'1 + P'.wireSizeOpt 1 3 x'2 + P'.wireSizeOpt 1 13 x'3 + P'.wireSizeOpt 1 4 x'4 +-               P'.wireSizeOpt 1 17 x'5-               + P'.wireSizeOpt 1 18 x'6-               + P'.wireSizeOpt 1 7 x'7-               + P'.wireSizeOpt 1 6 x'8-               + P'.wireSizeOpt 1 15 x'9-               + P'.wireSizeOpt 1 16 x'10-               + P'.wireSizeOpt 1 2 x'11-               + P'.wireSizeOpt 1 1 x'12-               + P'.wireSizeOpt 1 8 x'13-               + P'.wireSizeOpt 1 9 x'14-               + P'.wireSizeOpt 1 12 x'15-               + P'.wireSizeOpt 2 10 x'16-               + P'.wireSizeOpt 2 11 x'17-               + P'.wireSizeOpt 2 11 x'18-               + P'.wireSizeOpt 2 11 x'19-               + P'.wireSizeOpt 2 14 x'20-               + P'.wireSizeOpt 2 14 x'21-               + P'.wireSizeOpt 2 14 x'22-               + P'.wireSizeOpt 2 9 x'23-               + P'.wireSizeOpt 2 9 x'24-               + P'.wireSizeRep 2 5 x'25-               + P'.wireSizeRep 2 3 x'26-               + P'.wireSizeRep 2 13 x'27-               + P'.wireSizeRep 2 4 x'28-               + P'.wireSizeRep 2 17 x'29-               + P'.wireSizeRep 2 18 x'30-               + P'.wireSizeRep 2 7 x'31-               + P'.wireSizeRep 2 6 x'32-               + P'.wireSizeRep 2 15 x'33-               + P'.wireSizeRep 2 16 x'34-               + P'.wireSizeRep 2 2 x'35-               + P'.wireSizeRep 2 1 x'36-               + P'.wireSizeRep 2 8 x'37-               + P'.wireSizeRep 2 9 x'38-               + P'.wireSizeRep 2 12 x'39-               + P'.wireSizeRep 2 10 x'40-               + P'.wireSizeRep 2 11 x'41-               + P'.wireSizeRep 2 11 x'42-               + P'.wireSizeRep 2 11 x'43-               + P'.wireSizeRep 2 14 x'44-               + P'.wireSizeRep 2 14 x'45-               + P'.wireSizeRep 2 14 x'46-               + P'.wireSizeRep 2 9 x'47-               + P'.wireSizeRep 2 9 x'48-               + P'.wireSizeOpt 2 5 x'49-               + P'.wireSizeOpt 2 3 x'50-               + P'.wireSizeOpt 2 13 x'51-               + P'.wireSizeOpt 2 4 x'52-               + P'.wireSizeOpt 2 17 x'53-               + P'.wireSizeOpt 2 18 x'54-               + P'.wireSizeOpt 2 7 x'55-               + P'.wireSizeOpt 2 6 x'56-               + P'.wireSizeOpt 2 15 x'57-               + P'.wireSizeOpt 2 16 x'58-               + P'.wireSizeOpt 2 2 x'59-               + P'.wireSizeOpt 2 1 x'60-               + P'.wireSizeOpt 2 8 x'61-               + P'.wireSizeOpt 2 9 x'62-               + P'.wireSizeOpt 2 12 x'63-               + P'.wireSizeOpt 2 14 x'64-               + P'.wireSizeOpt 2 14 x'65-               + P'.wireSizeOpt 2 14 x'66-               + P'.wireSizeOpt 2 9 x'67-               + P'.wireSizeOpt 2 9 x'68)-  wirePut ft'-    self'@(TestAllTypes x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12 x'13 x'14 x'15 x'16 x'17 x'18 x'19 x'20 x'21 x'22 x'23-             x'24 x'25 x'26 x'27 x'28 x'29 x'30 x'31 x'32 x'33 x'34 x'35 x'36 x'37 x'38 x'39 x'40 x'41 x'42 x'43 x'44 x'45 x'46 x'47-             x'48 x'49 x'50 x'51 x'52 x'53 x'54 x'55 x'56 x'57 x'58 x'59 x'60 x'61 x'62 x'63 x'64 x'65 x'66 x'67 x'68)-    = 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 8 5 x'1-              P'.wirePutOpt 16 3 x'2-              P'.wirePutOpt 24 13 x'3-              P'.wirePutOpt 32 4 x'4-              P'.wirePutOpt 45 17 x'5-              P'.wirePutOpt 49 18 x'6-              P'.wirePutOpt 61 7 x'7-              P'.wirePutOpt 65 6 x'8-              P'.wirePutOpt 77 15 x'9-              P'.wirePutOpt 81 16 x'10-              P'.wirePutOpt 93 2 x'11-              P'.wirePutOpt 97 1 x'12-              P'.wirePutOpt 104 8 x'13-              P'.wirePutOpt 114 9 x'14-              P'.wirePutOpt 122 12 x'15-              P'.wirePutOpt 131 10 x'16-              P'.wirePutOpt 146 11 x'17-              P'.wirePutOpt 154 11 x'18-              P'.wirePutOpt 162 11 x'19-              P'.wirePutOpt 168 14 x'20-              P'.wirePutOpt 176 14 x'21-              P'.wirePutOpt 184 14 x'22-              P'.wirePutOpt 194 9 x'23-              P'.wirePutOpt 202 9 x'24-              P'.wirePutRep 248 5 x'25-              P'.wirePutRep 256 3 x'26-              P'.wirePutRep 264 13 x'27-              P'.wirePutRep 272 4 x'28-              P'.wirePutRep 285 17 x'29-              P'.wirePutRep 289 18 x'30-              P'.wirePutRep 301 7 x'31-              P'.wirePutRep 305 6 x'32-              P'.wirePutRep 317 15 x'33-              P'.wirePutRep 321 16 x'34-              P'.wirePutRep 333 2 x'35-              P'.wirePutRep 337 1 x'36-              P'.wirePutRep 344 8 x'37-              P'.wirePutRep 354 9 x'38-              P'.wirePutRep 362 12 x'39-              P'.wirePutRep 371 10 x'40-              P'.wirePutRep 386 11 x'41-              P'.wirePutRep 394 11 x'42-              P'.wirePutRep 402 11 x'43-              P'.wirePutRep 408 14 x'44-              P'.wirePutRep 416 14 x'45-              P'.wirePutRep 424 14 x'46-              P'.wirePutRep 434 9 x'47-              P'.wirePutRep 442 9 x'48-              P'.wirePutOpt 488 5 x'49-              P'.wirePutOpt 496 3 x'50-              P'.wirePutOpt 504 13 x'51-              P'.wirePutOpt 512 4 x'52-              P'.wirePutOpt 525 17 x'53-              P'.wirePutOpt 529 18 x'54-              P'.wirePutOpt 541 7 x'55-              P'.wirePutOpt 545 6 x'56-              P'.wirePutOpt 557 15 x'57-              P'.wirePutOpt 561 16 x'58-              P'.wirePutOpt 573 2 x'59-              P'.wirePutOpt 577 1 x'60-              P'.wirePutOpt 584 8 x'61-              P'.wirePutOpt 594 9 x'62-              P'.wirePutOpt 602 12 x'63-              P'.wirePutOpt 648 14 x'64-              P'.wirePutOpt 656 14 x'65-              P'.wirePutOpt 664 14 x'66-              P'.wirePutOpt 674 9 x'67-              P'.wirePutOpt 682 9 x'68-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{optional_int32 = P'.Just new'Field}) (P'.wireGet 5)-              2 -> P'.fmap (\ new'Field -> old'Self{optional_int64 = P'.Just new'Field}) (P'.wireGet 3)-              3 -> P'.fmap (\ new'Field -> old'Self{optional_uint32 = P'.Just new'Field}) (P'.wireGet 13)-              4 -> P'.fmap (\ new'Field -> old'Self{optional_uint64 = P'.Just new'Field}) (P'.wireGet 4)-              5 -> P'.fmap (\ new'Field -> old'Self{optional_sint32 = P'.Just new'Field}) (P'.wireGet 17)-              6 -> P'.fmap (\ new'Field -> old'Self{optional_sint64 = P'.Just new'Field}) (P'.wireGet 18)-              7 -> P'.fmap (\ new'Field -> old'Self{optional_fixed32 = P'.Just new'Field}) (P'.wireGet 7)-              8 -> P'.fmap (\ new'Field -> old'Self{optional_fixed64 = P'.Just new'Field}) (P'.wireGet 6)-              9 -> P'.fmap (\ new'Field -> old'Self{optional_sfixed32 = P'.Just new'Field}) (P'.wireGet 15)-              10 -> P'.fmap (\ new'Field -> old'Self{optional_sfixed64 = P'.Just new'Field}) (P'.wireGet 16)-              11 -> P'.fmap (\ new'Field -> old'Self{optional_float = P'.Just new'Field}) (P'.wireGet 2)-              12 -> P'.fmap (\ new'Field -> old'Self{optional_double = P'.Just new'Field}) (P'.wireGet 1)-              13 -> P'.fmap (\ new'Field -> old'Self{optional_bool = P'.Just new'Field}) (P'.wireGet 8)-              14 -> P'.fmap (\ new'Field -> old'Self{optional_string = P'.Just new'Field}) (P'.wireGet 9)-              15 -> P'.fmap (\ new'Field -> old'Self{optional_bytes = P'.Just new'Field}) (P'.wireGet 12)-              16-                -> P'.fmap (\ new'Field -> old'Self{optionalGroup = P'.mergeAppend (optionalGroup old'Self) (P'.Just new'Field)})-                     (P'.wireGet 10)-              18-                -> P'.fmap-                     (\ new'Field ->-                        old'Self{optional_nested_message = P'.mergeAppend (optional_nested_message old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              19-                -> P'.fmap-                     (\ new'Field ->-                        old'Self{optional_foreign_message = P'.mergeAppend (optional_foreign_message old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              20-                -> P'.fmap-                     (\ new'Field ->-                        old'Self{optional_import_message = P'.mergeAppend (optional_import_message old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              21 -> P'.fmap (\ new'Field -> old'Self{optional_nested_enum = P'.Just new'Field}) (P'.wireGet 14)-              22 -> P'.fmap (\ new'Field -> old'Self{optional_foreign_enum = P'.Just new'Field}) (P'.wireGet 14)-              23 -> P'.fmap (\ new'Field -> old'Self{optional_import_enum = P'.Just new'Field}) (P'.wireGet 14)-              24 -> P'.fmap (\ new'Field -> old'Self{optional_string_piece = P'.Just new'Field}) (P'.wireGet 9)-              25 -> P'.fmap (\ new'Field -> old'Self{optional_cord = P'.Just new'Field}) (P'.wireGet 9)-              31 -> P'.fmap (\ new'Field -> old'Self{repeated_int32 = P'.append (repeated_int32 old'Self) new'Field}) (P'.wireGet 5)-              32 -> P'.fmap (\ new'Field -> old'Self{repeated_int64 = P'.append (repeated_int64 old'Self) new'Field}) (P'.wireGet 3)-              33-                -> P'.fmap (\ new'Field -> old'Self{repeated_uint32 = P'.append (repeated_uint32 old'Self) new'Field})-                     (P'.wireGet 13)-              34-                -> P'.fmap (\ new'Field -> old'Self{repeated_uint64 = P'.append (repeated_uint64 old'Self) new'Field})-                     (P'.wireGet 4)-              35-                -> P'.fmap (\ new'Field -> old'Self{repeated_sint32 = P'.append (repeated_sint32 old'Self) new'Field})-                     (P'.wireGet 17)-              36-                -> P'.fmap (\ new'Field -> old'Self{repeated_sint64 = P'.append (repeated_sint64 old'Self) new'Field})-                     (P'.wireGet 18)-              37-                -> P'.fmap (\ new'Field -> old'Self{repeated_fixed32 = P'.append (repeated_fixed32 old'Self) new'Field})-                     (P'.wireGet 7)-              38-                -> P'.fmap (\ new'Field -> old'Self{repeated_fixed64 = P'.append (repeated_fixed64 old'Self) new'Field})-                     (P'.wireGet 6)-              39-                -> P'.fmap (\ new'Field -> old'Self{repeated_sfixed32 = P'.append (repeated_sfixed32 old'Self) new'Field})-                     (P'.wireGet 15)-              40-                -> P'.fmap (\ new'Field -> old'Self{repeated_sfixed64 = P'.append (repeated_sfixed64 old'Self) new'Field})-                     (P'.wireGet 16)-              41 -> P'.fmap (\ new'Field -> old'Self{repeated_float = P'.append (repeated_float old'Self) new'Field}) (P'.wireGet 2)-              42-                -> P'.fmap (\ new'Field -> old'Self{repeated_double = P'.append (repeated_double old'Self) new'Field})-                     (P'.wireGet 1)-              43 -> P'.fmap (\ new'Field -> old'Self{repeated_bool = P'.append (repeated_bool old'Self) new'Field}) (P'.wireGet 8)-              44-                -> P'.fmap (\ new'Field -> old'Self{repeated_string = P'.append (repeated_string old'Self) new'Field})-                     (P'.wireGet 9)-              45-                -> P'.fmap (\ new'Field -> old'Self{repeated_bytes = P'.append (repeated_bytes old'Self) new'Field}) (P'.wireGet 12)-              46 -> P'.fmap (\ new'Field -> old'Self{repeatedGroup = P'.append (repeatedGroup old'Self) new'Field}) (P'.wireGet 10)-              48-                -> P'.fmap-                     (\ new'Field -> old'Self{repeated_nested_message = P'.append (repeated_nested_message old'Self) new'Field})-                     (P'.wireGet 11)-              49-                -> P'.fmap-                     (\ new'Field -> old'Self{repeated_foreign_message = P'.append (repeated_foreign_message old'Self) new'Field})-                     (P'.wireGet 11)-              50-                -> P'.fmap-                     (\ new'Field -> old'Self{repeated_import_message = P'.append (repeated_import_message old'Self) new'Field})-                     (P'.wireGet 11)-              51-                -> P'.fmap (\ new'Field -> old'Self{repeated_nested_enum = P'.append (repeated_nested_enum old'Self) new'Field})-                     (P'.wireGet 14)-              52-                -> P'.fmap (\ new'Field -> old'Self{repeated_foreign_enum = P'.append (repeated_foreign_enum old'Self) new'Field})-                     (P'.wireGet 14)-              53-                -> P'.fmap (\ new'Field -> old'Self{repeated_import_enum = P'.append (repeated_import_enum old'Self) new'Field})-                     (P'.wireGet 14)-              54-                -> P'.fmap (\ new'Field -> old'Self{repeated_string_piece = P'.append (repeated_string_piece old'Self) new'Field})-                     (P'.wireGet 9)-              55 -> P'.fmap (\ new'Field -> old'Self{repeated_cord = P'.append (repeated_cord old'Self) new'Field}) (P'.wireGet 9)-              61 -> P'.fmap (\ new'Field -> old'Self{default_int32 = P'.Just new'Field}) (P'.wireGet 5)-              62 -> P'.fmap (\ new'Field -> old'Self{default_int64 = P'.Just new'Field}) (P'.wireGet 3)-              63 -> P'.fmap (\ new'Field -> old'Self{default_uint32 = P'.Just new'Field}) (P'.wireGet 13)-              64 -> P'.fmap (\ new'Field -> old'Self{default_uint64 = P'.Just new'Field}) (P'.wireGet 4)-              65 -> P'.fmap (\ new'Field -> old'Self{default_sint32 = P'.Just new'Field}) (P'.wireGet 17)-              66 -> P'.fmap (\ new'Field -> old'Self{default_sint64 = P'.Just new'Field}) (P'.wireGet 18)-              67 -> P'.fmap (\ new'Field -> old'Self{default_fixed32 = P'.Just new'Field}) (P'.wireGet 7)-              68 -> P'.fmap (\ new'Field -> old'Self{default_fixed64 = P'.Just new'Field}) (P'.wireGet 6)-              69 -> P'.fmap (\ new'Field -> old'Self{default_sfixed32 = P'.Just new'Field}) (P'.wireGet 15)-              70 -> P'.fmap (\ new'Field -> old'Self{default_sfixed64 = P'.Just new'Field}) (P'.wireGet 16)-              71 -> P'.fmap (\ new'Field -> old'Self{default_float = P'.Just new'Field}) (P'.wireGet 2)-              72 -> P'.fmap (\ new'Field -> old'Self{default_double = P'.Just new'Field}) (P'.wireGet 1)-              73 -> P'.fmap (\ new'Field -> old'Self{default_bool = P'.Just new'Field}) (P'.wireGet 8)-              74 -> P'.fmap (\ new'Field -> old'Self{default_string = P'.Just new'Field}) (P'.wireGet 9)-              75 -> P'.fmap (\ new'Field -> old'Self{default_bytes = P'.Just new'Field}) (P'.wireGet 12)-              81 -> P'.fmap (\ new'Field -> old'Self{default_nested_enum = P'.Just new'Field}) (P'.wireGet 14)-              82 -> P'.fmap (\ new'Field -> old'Self{default_foreign_enum = P'.Just new'Field}) (P'.wireGet 14)-              83 -> P'.fmap (\ new'Field -> old'Self{default_import_enum = P'.Just new'Field}) (P'.wireGet 14)-              84 -> P'.fmap (\ new'Field -> old'Self{default_string_piece = P'.Just new'Field}) (P'.wireGet 9)-              85 -> P'.fmap (\ new'Field -> old'Self{default_cord = P'.Just new'Field}) (P'.wireGet 9)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestAllTypes) TestAllTypes where-  getVal m' f' = f' m'- -instance P'.GPB TestAllTypes- -instance P'.ReflectDescriptor TestAllTypes where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestAllTypes\"}, descFilePath = [\"UnittestProto\",\"TestAllTypes.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_int32\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_int64\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 3}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_uint32\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_uint64\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_sint32\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 45}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 17}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_sint64\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 49}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 18}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_fixed32\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 61}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 7}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_fixed64\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 65}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 6}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_sfixed32\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 77}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 15}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_sfixed64\"}, fieldNumber = FieldId {getFieldId = 10}, wireTag = WireTag {getWireTag = 81}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 16}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_float\"}, fieldNumber = FieldId {getFieldId = 11}, wireTag = WireTag {getWireTag = 93}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 2}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_double\"}, fieldNumber = FieldId {getFieldId = 12}, wireTag = WireTag {getWireTag = 97}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 1}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_bool\"}, fieldNumber = FieldId {getFieldId = 13}, wireTag = WireTag {getWireTag = 104}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_string\"}, fieldNumber = FieldId {getFieldId = 14}, wireTag = WireTag {getWireTag = 114}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_bytes\"}, fieldNumber = FieldId {getFieldId = 15}, wireTag = WireTag {getWireTag = 122}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optionalGroup\"}, fieldNumber = FieldId {getFieldId = 16}, wireTag = WireTag {getWireTag = 131}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 10}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"OptionalGroup\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_nested_message\"}, fieldNumber = FieldId {getFieldId = 18}, wireTag = WireTag {getWireTag = 146}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_foreign_message\"}, fieldNumber = FieldId {getFieldId = 19}, wireTag = WireTag {getWireTag = 154}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_import_message\"}, fieldNumber = FieldId {getFieldId = 20}, wireTag = WireTag {getWireTag = 162}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"Com.Google.Protobuf.Test\", baseName = \"ImportMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_nested_enum\"}, fieldNumber = FieldId {getFieldId = 21}, wireTag = WireTag {getWireTag = 168}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_foreign_enum\"}, fieldNumber = FieldId {getFieldId = 22}, wireTag = WireTag {getWireTag = 176}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_import_enum\"}, fieldNumber = FieldId {getFieldId = 23}, wireTag = WireTag {getWireTag = 184}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"Com.Google.Protobuf.Test\", baseName = \"ImportEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_string_piece\"}, fieldNumber = FieldId {getFieldId = 24}, wireTag = WireTag {getWireTag = 194}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"optional_cord\"}, fieldNumber = FieldId {getFieldId = 25}, wireTag = WireTag {getWireTag = 202}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_int32\"}, fieldNumber = FieldId {getFieldId = 31}, wireTag = WireTag {getWireTag = 248}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_int64\"}, fieldNumber = FieldId {getFieldId = 32}, wireTag = WireTag {getWireTag = 256}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 3}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_uint32\"}, fieldNumber = FieldId {getFieldId = 33}, wireTag = WireTag {getWireTag = 264}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_uint64\"}, fieldNumber = FieldId {getFieldId = 34}, wireTag = WireTag {getWireTag = 272}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_sint32\"}, fieldNumber = FieldId {getFieldId = 35}, wireTag = WireTag {getWireTag = 285}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 17}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_sint64\"}, fieldNumber = FieldId {getFieldId = 36}, wireTag = WireTag {getWireTag = 289}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 18}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_fixed32\"}, fieldNumber = FieldId {getFieldId = 37}, wireTag = WireTag {getWireTag = 301}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 7}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_fixed64\"}, fieldNumber = FieldId {getFieldId = 38}, wireTag = WireTag {getWireTag = 305}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 6}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_sfixed32\"}, fieldNumber = FieldId {getFieldId = 39}, wireTag = WireTag {getWireTag = 317}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 15}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_sfixed64\"}, fieldNumber = FieldId {getFieldId = 40}, wireTag = WireTag {getWireTag = 321}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 16}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_float\"}, fieldNumber = FieldId {getFieldId = 41}, wireTag = WireTag {getWireTag = 333}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 2}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_double\"}, fieldNumber = FieldId {getFieldId = 42}, wireTag = WireTag {getWireTag = 337}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 1}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_bool\"}, fieldNumber = FieldId {getFieldId = 43}, wireTag = WireTag {getWireTag = 344}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_string\"}, fieldNumber = FieldId {getFieldId = 44}, wireTag = WireTag {getWireTag = 354}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_bytes\"}, fieldNumber = FieldId {getFieldId = 45}, wireTag = WireTag {getWireTag = 362}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeatedGroup\"}, fieldNumber = FieldId {getFieldId = 46}, wireTag = WireTag {getWireTag = 371}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 10}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"RepeatedGroup\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_nested_message\"}, fieldNumber = FieldId {getFieldId = 48}, wireTag = WireTag {getWireTag = 386}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_foreign_message\"}, fieldNumber = FieldId {getFieldId = 49}, wireTag = WireTag {getWireTag = 394}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_import_message\"}, fieldNumber = FieldId {getFieldId = 50}, wireTag = WireTag {getWireTag = 402}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"Com.Google.Protobuf.Test\", baseName = \"ImportMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_nested_enum\"}, fieldNumber = FieldId {getFieldId = 51}, wireTag = WireTag {getWireTag = 408}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_foreign_enum\"}, fieldNumber = FieldId {getFieldId = 52}, wireTag = WireTag {getWireTag = 416}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_import_enum\"}, fieldNumber = FieldId {getFieldId = 53}, wireTag = WireTag {getWireTag = 424}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"Com.Google.Protobuf.Test\", baseName = \"ImportEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_string_piece\"}, fieldNumber = FieldId {getFieldId = 54}, wireTag = WireTag {getWireTag = 434}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"repeated_cord\"}, fieldNumber = FieldId {getFieldId = 55}, wireTag = WireTag {getWireTag = 442}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_int32\"}, fieldNumber = FieldId {getFieldId = 61}, wireTag = WireTag {getWireTag = 488}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Just (Chunk \"41\" Empty), hsDefault = Just (HsDef'Integer 41)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_int64\"}, fieldNumber = FieldId {getFieldId = 62}, wireTag = WireTag {getWireTag = 496}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 3}, typeName = Nothing, hsRawDefault = Just (Chunk \"42\" Empty), hsDefault = Just (HsDef'Integer 42)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_uint32\"}, fieldNumber = FieldId {getFieldId = 63}, wireTag = WireTag {getWireTag = 504}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Just (Chunk \"43\" Empty), hsDefault = Just (HsDef'Integer 43)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_uint64\"}, fieldNumber = FieldId {getFieldId = 64}, wireTag = WireTag {getWireTag = 512}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Just (Chunk \"44\" Empty), hsDefault = Just (HsDef'Integer 44)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_sint32\"}, fieldNumber = FieldId {getFieldId = 65}, wireTag = WireTag {getWireTag = 525}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 17}, typeName = Nothing, hsRawDefault = Just (Chunk \"-45\" Empty), hsDefault = Just (HsDef'Integer (-45))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_sint64\"}, fieldNumber = FieldId {getFieldId = 66}, wireTag = WireTag {getWireTag = 529}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 18}, typeName = Nothing, hsRawDefault = Just (Chunk \"46\" Empty), hsDefault = Just (HsDef'Integer 46)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_fixed32\"}, fieldNumber = FieldId {getFieldId = 67}, wireTag = WireTag {getWireTag = 541}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 7}, typeName = Nothing, hsRawDefault = Just (Chunk \"47\" Empty), hsDefault = Just (HsDef'Integer 47)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_fixed64\"}, fieldNumber = FieldId {getFieldId = 68}, wireTag = WireTag {getWireTag = 545}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 6}, typeName = Nothing, hsRawDefault = Just (Chunk \"48\" Empty), hsDefault = Just (HsDef'Integer 48)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_sfixed32\"}, fieldNumber = FieldId {getFieldId = 69}, wireTag = WireTag {getWireTag = 557}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 15}, typeName = Nothing, hsRawDefault = Just (Chunk \"49\" Empty), hsDefault = Just (HsDef'Integer 49)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_sfixed64\"}, fieldNumber = FieldId {getFieldId = 70}, wireTag = WireTag {getWireTag = 561}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 16}, typeName = Nothing, hsRawDefault = Just (Chunk \"-50\" Empty), hsDefault = Just (HsDef'Integer (-50))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_float\"}, fieldNumber = FieldId {getFieldId = 71}, wireTag = WireTag {getWireTag = 573}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 2}, typeName = Nothing, hsRawDefault = Just (Chunk \"51.5\" Empty), hsDefault = Just (HsDef'Rational (103%2))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_double\"}, fieldNumber = FieldId {getFieldId = 72}, wireTag = WireTag {getWireTag = 577}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 1}, typeName = Nothing, hsRawDefault = Just (Chunk \"52000.0\" Empty), hsDefault = Just (HsDef'Rational (52000%1))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_bool\"}, fieldNumber = FieldId {getFieldId = 73}, wireTag = WireTag {getWireTag = 584}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 8}, typeName = Nothing, hsRawDefault = Just (Chunk \"true\" Empty), hsDefault = Just (HsDef'Bool True)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_string\"}, fieldNumber = FieldId {getFieldId = 74}, wireTag = WireTag {getWireTag = 594}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Just (Chunk \"hello\" Empty), hsDefault = Just (HsDef'ByteString (Chunk \"hello\" Empty))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_bytes\"}, fieldNumber = FieldId {getFieldId = 75}, wireTag = WireTag {getWireTag = 602}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Just (Chunk \"world\" Empty), hsDefault = Just (HsDef'ByteString (Chunk \"world\" Empty))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_nested_enum\"}, fieldNumber = FieldId {getFieldId = 81}, wireTag = WireTag {getWireTag = 648}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedEnum\"}), hsRawDefault = Just (Chunk \"BAR\" Empty), hsDefault = Just (HsDef'Enum \"BAR\")},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_foreign_enum\"}, fieldNumber = FieldId {getFieldId = 82}, wireTag = WireTag {getWireTag = 656}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignEnum\"}), hsRawDefault = Just (Chunk \"FOREIGN_BAR\" Empty), hsDefault = Just (HsDef'Enum \"FOREIGN_BAR\")},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_import_enum\"}, fieldNumber = FieldId {getFieldId = 83}, wireTag = WireTag {getWireTag = 664}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"Com.Google.Protobuf.Test\", baseName = \"ImportEnum\"}), hsRawDefault = Just (Chunk \"IMPORT_BAR\" Empty), hsDefault = Just (HsDef'Enum \"IMPORT_BAR\")},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_string_piece\"}, fieldNumber = FieldId {getFieldId = 84}, wireTag = WireTag {getWireTag = 674}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Just (Chunk \"abc\" Empty), hsDefault = Just (HsDef'ByteString (Chunk \"abc\" Empty))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"default_cord\"}, fieldNumber = FieldId {getFieldId = 85}, wireTag = WireTag {getWireTag = 682}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Just (Chunk \"123\" Empty), hsDefault = Just (HsDef'ByteString (Chunk \"123\" Empty))}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestAllTypes/NestedEnum.hs
@@ -1,47 +0,0 @@-module UnittestProto.TestAllTypes.NestedEnum (NestedEnum(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data NestedEnum = FOO-                | BAR-                | BAZ-                deriving (P'.Read, P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable NestedEnum- -instance P'.Bounded NestedEnum where-  minBound = FOO-  maxBound = BAZ- -instance P'.Default NestedEnum where-  defaultValue = FOO- -instance P'.Enum NestedEnum where-  fromEnum (FOO) = 1-  fromEnum (BAR) = 2-  fromEnum (BAZ) = 3-  toEnum 1 = FOO-  toEnum 2 = BAR-  toEnum 3 = BAZ-  succ (FOO) = BAR-  succ (BAR) = BAZ-  pred (BAR) = FOO-  pred (BAZ) = BAR- -instance P'.Wire NestedEnum where-  wireSize ft' enum = P'.wireSize ft' (P'.fromEnum enum)-  wirePut ft' enum = P'.wirePut ft' (P'.fromEnum enum)-  wireGet 14 = P'.fmap P'.toEnum (P'.wireGet 14)-  wireGet ft' = P'.wireGetErr ft'- -instance P'.GPB NestedEnum- -instance P'.MessageAPI msg' (msg' -> NestedEnum) NestedEnum where-  getVal m' f' = f' m'- -instance P'.ReflectEnum NestedEnum where-  reflectEnum = [(1, "FOO", FOO), (2, "BAR", BAR), (3, "BAZ", BAZ)]-  reflectEnumInfo _-    = P'.EnumInfo (P'.ProtoName "" "UnittestProto.TestAllTypes" "NestedEnum") ["UnittestProto", "TestAllTypes", "NestedEnum.hs"]-        [(1, "FOO"), (2, "BAR"), (3, "BAZ")]
− tests/UnittestProto/TestAllTypes/NestedMessage.hs
@@ -1,55 +0,0 @@-module UnittestProto.TestAllTypes.NestedMessage (NestedMessage(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data NestedMessage = NestedMessage{bb :: P'.Maybe P'.Int32}-                   deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable NestedMessage where-  mergeEmpty = NestedMessage P'.mergeEmpty-  mergeAppend (NestedMessage x'1) (NestedMessage y'1) = NestedMessage (P'.mergeAppend x'1 y'1)- -instance P'.Default NestedMessage where-  defaultValue = NestedMessage P'.defaultValue- -instance P'.Wire NestedMessage where-  wireSize ft' self'@(NestedMessage x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 5 x'1)-  wirePut ft' self'@(NestedMessage 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 8 5 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{bb = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> NestedMessage) NestedMessage where-  getVal m' f' = f' m'- -instance P'.GPB NestedMessage- -instance P'.ReflectDescriptor NestedMessage where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedMessage\"}, descFilePath = [\"UnittestProto\",\"TestAllTypes\",\"NestedMessage.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes.NestedMessage\", baseName = \"bb\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestAllTypes/OptionalGroup.hs
@@ -1,55 +0,0 @@-module UnittestProto.TestAllTypes.OptionalGroup (OptionalGroup(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data OptionalGroup = OptionalGroup{a :: P'.Maybe P'.Int32}-                   deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable OptionalGroup where-  mergeEmpty = OptionalGroup P'.mergeEmpty-  mergeAppend (OptionalGroup x'1) (OptionalGroup y'1) = OptionalGroup (P'.mergeAppend x'1 y'1)- -instance P'.Default OptionalGroup where-  defaultValue = OptionalGroup P'.defaultValue- -instance P'.Wire OptionalGroup where-  wireSize ft' self'@(OptionalGroup x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 2 5 x'1)-  wirePut ft' self'@(OptionalGroup 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 136 5 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              17 -> P'.fmap (\ new'Field -> old'Self{a = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> OptionalGroup) OptionalGroup where-  getVal m' f' = f' m'- -instance P'.GPB OptionalGroup- -instance P'.ReflectDescriptor OptionalGroup where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"OptionalGroup\"}, descFilePath = [\"UnittestProto\",\"TestAllTypes\",\"OptionalGroup.hs\"], isGroup = True, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes.OptionalGroup\", baseName = \"a\"}, fieldNumber = FieldId {getFieldId = 17}, wireTag = WireTag {getWireTag = 136}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestAllTypes/RepeatedGroup.hs
@@ -1,55 +0,0 @@-module UnittestProto.TestAllTypes.RepeatedGroup (RepeatedGroup(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data RepeatedGroup = RepeatedGroup{a :: P'.Maybe P'.Int32}-                   deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable RepeatedGroup where-  mergeEmpty = RepeatedGroup P'.mergeEmpty-  mergeAppend (RepeatedGroup x'1) (RepeatedGroup y'1) = RepeatedGroup (P'.mergeAppend x'1 y'1)- -instance P'.Default RepeatedGroup where-  defaultValue = RepeatedGroup P'.defaultValue- -instance P'.Wire RepeatedGroup where-  wireSize ft' self'@(RepeatedGroup x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 2 5 x'1)-  wirePut ft' self'@(RepeatedGroup 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 376 5 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              47 -> P'.fmap (\ new'Field -> old'Self{a = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> RepeatedGroup) RepeatedGroup where-  getVal m' f' = f' m'- -instance P'.GPB RepeatedGroup- -instance P'.ReflectDescriptor RepeatedGroup where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"RepeatedGroup\"}, descFilePath = [\"UnittestProto\",\"TestAllTypes\",\"RepeatedGroup.hs\"], isGroup = True, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes.RepeatedGroup\", baseName = \"a\"}, fieldNumber = FieldId {getFieldId = 47}, wireTag = WireTag {getWireTag = 376}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestCamelCaseFieldNames.hs
@@ -1,131 +0,0 @@-module UnittestProto.TestCamelCaseFieldNames (TestCamelCaseFieldNames(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified UnittestProto.ForeignEnum as UnittestProto (ForeignEnum)-import qualified UnittestProto.ForeignMessage as UnittestProto (ForeignMessage)- -data TestCamelCaseFieldNames = TestCamelCaseFieldNames{primitiveField :: P'.Maybe P'.Int32, stringField :: P'.Maybe P'.Utf8,-                                                       enumField :: P'.Maybe UnittestProto.ForeignEnum,-                                                       messageField :: P'.Maybe UnittestProto.ForeignMessage,-                                                       stringPieceField :: P'.Maybe P'.Utf8, cordField :: P'.Maybe P'.Utf8,-                                                       repeatedPrimitiveField :: P'.Seq P'.Int32,-                                                       repeatedStringField :: P'.Seq P'.Utf8,-                                                       repeatedEnumField :: P'.Seq UnittestProto.ForeignEnum,-                                                       repeatedMessageField :: P'.Seq UnittestProto.ForeignMessage,-                                                       repeatedStringPieceField :: P'.Seq P'.Utf8,-                                                       repeatedCordField :: P'.Seq P'.Utf8}-                             deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestCamelCaseFieldNames where-  mergeEmpty-    = TestCamelCaseFieldNames P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-  mergeAppend (TestCamelCaseFieldNames x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12)-    (TestCamelCaseFieldNames y'1 y'2 y'3 y'4 y'5 y'6 y'7 y'8 y'9 y'10 y'11 y'12)-    = TestCamelCaseFieldNames (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)-        (P'.mergeAppend x'5 y'5)-        (P'.mergeAppend x'6 y'6)-        (P'.mergeAppend x'7 y'7)-        (P'.mergeAppend x'8 y'8)-        (P'.mergeAppend x'9 y'9)-        (P'.mergeAppend x'10 y'10)-        (P'.mergeAppend x'11 y'11)-        (P'.mergeAppend x'12 y'12)- -instance P'.Default TestCamelCaseFieldNames where-  defaultValue-    = TestCamelCaseFieldNames P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue- -instance P'.Wire TestCamelCaseFieldNames where-  wireSize ft' self'@(TestCamelCaseFieldNames x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size-          = (P'.wireSizeOpt 1 5 x'1 + P'.wireSizeOpt 1 9 x'2 + P'.wireSizeOpt 1 14 x'3 + P'.wireSizeOpt 1 11 x'4 +-               P'.wireSizeOpt 1 9 x'5-               + P'.wireSizeOpt 1 9 x'6-               + P'.wireSizeRep 1 5 x'7-               + P'.wireSizeRep 1 9 x'8-               + P'.wireSizeRep 1 14 x'9-               + P'.wireSizeRep 1 11 x'10-               + P'.wireSizeRep 1 9 x'11-               + P'.wireSizeRep 1 9 x'12)-  wirePut ft' self'@(TestCamelCaseFieldNames x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12)-    = 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 8 5 x'1-              P'.wirePutOpt 18 9 x'2-              P'.wirePutOpt 24 14 x'3-              P'.wirePutOpt 34 11 x'4-              P'.wirePutOpt 42 9 x'5-              P'.wirePutOpt 50 9 x'6-              P'.wirePutRep 56 5 x'7-              P'.wirePutRep 66 9 x'8-              P'.wirePutRep 72 14 x'9-              P'.wirePutRep 82 11 x'10-              P'.wirePutRep 90 9 x'11-              P'.wirePutRep 98 9 x'12-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{primitiveField = P'.Just new'Field}) (P'.wireGet 5)-              2 -> P'.fmap (\ new'Field -> old'Self{stringField = P'.Just new'Field}) (P'.wireGet 9)-              3 -> P'.fmap (\ new'Field -> old'Self{enumField = P'.Just new'Field}) (P'.wireGet 14)-              4 -> P'.fmap (\ new'Field -> old'Self{messageField = P'.mergeAppend (messageField old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              5 -> P'.fmap (\ new'Field -> old'Self{stringPieceField = P'.Just new'Field}) (P'.wireGet 9)-              6 -> P'.fmap (\ new'Field -> old'Self{cordField = P'.Just new'Field}) (P'.wireGet 9)-              7 -> P'.fmap (\ new'Field -> old'Self{repeatedPrimitiveField = P'.append (repeatedPrimitiveField old'Self) new'Field})-                     (P'.wireGet 5)-              8 -> P'.fmap (\ new'Field -> old'Self{repeatedStringField = P'.append (repeatedStringField old'Self) new'Field})-                     (P'.wireGet 9)-              9 -> P'.fmap (\ new'Field -> old'Self{repeatedEnumField = P'.append (repeatedEnumField old'Self) new'Field})-                     (P'.wireGet 14)-              10-                -> P'.fmap (\ new'Field -> old'Self{repeatedMessageField = P'.append (repeatedMessageField old'Self) new'Field})-                     (P'.wireGet 11)-              11-                -> P'.fmap-                     (\ new'Field -> old'Self{repeatedStringPieceField = P'.append (repeatedStringPieceField old'Self) new'Field})-                     (P'.wireGet 9)-              12-                -> P'.fmap (\ new'Field -> old'Self{repeatedCordField = P'.append (repeatedCordField old'Self) new'Field})-                     (P'.wireGet 9)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestCamelCaseFieldNames) TestCamelCaseFieldNames where-  getVal m' f' = f' m'- -instance P'.GPB TestCamelCaseFieldNames- -instance P'.ReflectDescriptor TestCamelCaseFieldNames where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestCamelCaseFieldNames\"}, descFilePath = [\"UnittestProto\",\"TestCamelCaseFieldNames.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"primitiveField\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"stringField\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"enumField\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"messageField\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 34}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"stringPieceField\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 42}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"cordField\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 50}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"repeatedPrimitiveField\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 56}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"repeatedStringField\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 66}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"repeatedEnumField\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 72}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 14}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignEnum\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"repeatedMessageField\"}, fieldNumber = FieldId {getFieldId = 10}, wireTag = WireTag {getWireTag = 82}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"repeatedStringPieceField\"}, fieldNumber = FieldId {getFieldId = 11}, wireTag = WireTag {getWireTag = 90}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestCamelCaseFieldNames\", baseName = \"repeatedCordField\"}, fieldNumber = FieldId {getFieldId = 12}, wireTag = WireTag {getWireTag = 98}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestDupFieldNumber.hs
@@ -1,63 +0,0 @@-module UnittestProto.TestDupFieldNumber (TestDupFieldNumber(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified UnittestProto.TestDupFieldNumber.Bar as UnittestProto.TestDupFieldNumber (Bar)-import qualified UnittestProto.TestDupFieldNumber.Foo as UnittestProto.TestDupFieldNumber (Foo)- -data TestDupFieldNumber = TestDupFieldNumber{a :: P'.Maybe P'.Int32, foo :: P'.Maybe UnittestProto.TestDupFieldNumber.Foo,-                                             bar :: P'.Maybe UnittestProto.TestDupFieldNumber.Bar}-                        deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestDupFieldNumber where-  mergeEmpty = TestDupFieldNumber P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-  mergeAppend (TestDupFieldNumber x'1 x'2 x'3) (TestDupFieldNumber y'1 y'2 y'3)-    = TestDupFieldNumber (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3)- -instance P'.Default TestDupFieldNumber where-  defaultValue = TestDupFieldNumber P'.defaultValue P'.defaultValue P'.defaultValue- -instance P'.Wire TestDupFieldNumber where-  wireSize ft' self'@(TestDupFieldNumber x'1 x'2 x'3)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 5 x'1 + P'.wireSizeOpt 1 10 x'2 + P'.wireSizeOpt 1 10 x'3)-  wirePut ft' self'@(TestDupFieldNumber x'1 x'2 x'3)-    = 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 8 5 x'1-              P'.wirePutOpt 19 10 x'2-              P'.wirePutOpt 27 10 x'3-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{a = P'.Just new'Field}) (P'.wireGet 5)-              2 -> P'.fmap (\ new'Field -> old'Self{foo = P'.mergeAppend (foo old'Self) (P'.Just new'Field)}) (P'.wireGet 10)-              3 -> P'.fmap (\ new'Field -> old'Self{bar = P'.mergeAppend (bar old'Self) (P'.Just new'Field)}) (P'.wireGet 10)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestDupFieldNumber) TestDupFieldNumber where-  getVal m' f' = f' m'- -instance P'.GPB TestDupFieldNumber- -instance P'.ReflectDescriptor TestDupFieldNumber where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestDupFieldNumber\"}, descFilePath = [\"UnittestProto\",\"TestDupFieldNumber.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestDupFieldNumber\", baseName = \"a\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestDupFieldNumber\", baseName = \"foo\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 19}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 10}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestDupFieldNumber\", baseName = \"Foo\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestDupFieldNumber\", baseName = \"bar\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 27}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 10}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestDupFieldNumber\", baseName = \"Bar\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestDupFieldNumber/Bar.hs
@@ -1,55 +0,0 @@-module UnittestProto.TestDupFieldNumber.Bar (Bar(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data Bar = Bar{a :: P'.Maybe P'.Int32}-         deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable Bar where-  mergeEmpty = Bar P'.mergeEmpty-  mergeAppend (Bar x'1) (Bar y'1) = Bar (P'.mergeAppend x'1 y'1)- -instance P'.Default Bar where-  defaultValue = Bar P'.defaultValue- -instance P'.Wire Bar where-  wireSize ft' self'@(Bar x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 5 x'1)-  wirePut ft' self'@(Bar 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 8 5 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{a = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> Bar) Bar where-  getVal m' f' = f' m'- -instance P'.GPB Bar- -instance P'.ReflectDescriptor Bar where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestDupFieldNumber\", baseName = \"Bar\"}, descFilePath = [\"UnittestProto\",\"TestDupFieldNumber\",\"Bar.hs\"], isGroup = True, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestDupFieldNumber.Bar\", baseName = \"a\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestDupFieldNumber/Foo.hs
@@ -1,55 +0,0 @@-module UnittestProto.TestDupFieldNumber.Foo (Foo(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data Foo = Foo{a :: P'.Maybe P'.Int32}-         deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable Foo where-  mergeEmpty = Foo P'.mergeEmpty-  mergeAppend (Foo x'1) (Foo y'1) = Foo (P'.mergeAppend x'1 y'1)- -instance P'.Default Foo where-  defaultValue = Foo P'.defaultValue- -instance P'.Wire Foo where-  wireSize ft' self'@(Foo x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 5 x'1)-  wirePut ft' self'@(Foo 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 8 5 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{a = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> Foo) Foo where-  getVal m' f' = f' m'- -instance P'.GPB Foo- -instance P'.ReflectDescriptor Foo where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestDupFieldNumber\", baseName = \"Foo\"}, descFilePath = [\"UnittestProto\",\"TestDupFieldNumber\",\"Foo.hs\"], isGroup = True, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestDupFieldNumber.Foo\", baseName = \"a\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestEmptyMessage.hs
@@ -1,54 +0,0 @@-module UnittestProto.TestEmptyMessage (TestEmptyMessage(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data TestEmptyMessage = TestEmptyMessage{}-                      deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestEmptyMessage where-  mergeEmpty = TestEmptyMessage-  mergeAppend (TestEmptyMessage) (TestEmptyMessage) = TestEmptyMessage- -instance P'.Default TestEmptyMessage where-  defaultValue = TestEmptyMessage- -instance P'.Wire TestEmptyMessage where-  wireSize ft' self'@(TestEmptyMessage)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = 0-  wirePut ft' self'@(TestEmptyMessage)-    = 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'.return ()-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestEmptyMessage) TestEmptyMessage where-  getVal m' f' = f' m'- -instance P'.GPB TestEmptyMessage- -instance P'.ReflectDescriptor TestEmptyMessage where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestEmptyMessage\"}, descFilePath = [\"UnittestProto\",\"TestEmptyMessage.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestEmptyMessageWithExtensions.hs
@@ -1,60 +0,0 @@-module UnittestProto.TestEmptyMessageWithExtensions (TestEmptyMessageWithExtensions(..)) where-import Prelude ((+), (<=), (&&), ( || ))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data TestEmptyMessageWithExtensions = TestEmptyMessageWithExtensions{ext'field :: P'.ExtField}-                                    deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.ExtendMessage TestEmptyMessageWithExtensions where-  getExtField = ext'field-  putExtField e'f msg = msg{ext'field = e'f}-  validExtRanges msg = P'.extRanges (P'.reflectDescriptorInfo msg)- -instance P'.Mergeable TestEmptyMessageWithExtensions where-  mergeEmpty = TestEmptyMessageWithExtensions P'.mergeEmpty-  mergeAppend (TestEmptyMessageWithExtensions x'1) (TestEmptyMessageWithExtensions y'1)-    = TestEmptyMessageWithExtensions (P'.mergeAppend x'1 y'1)- -instance P'.Default TestEmptyMessageWithExtensions where-  defaultValue = TestEmptyMessageWithExtensions P'.defaultValue- -instance P'.Wire TestEmptyMessageWithExtensions where-  wireSize ft' self'@(TestEmptyMessageWithExtensions x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeExtField x'1)-  wirePut ft' self'@(TestEmptyMessageWithExtensions 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'.wirePutExtField x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessageExt update'Self-        11 -> P'.getMessageExt update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestEmptyMessageWithExtensions) TestEmptyMessageWithExtensions where-  getVal m' f' = f' m'- -instance P'.GPB TestEmptyMessageWithExtensions- -instance P'.ReflectDescriptor TestEmptyMessageWithExtensions where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestEmptyMessageWithExtensions\"}, descFilePath = [\"UnittestProto\",\"TestEmptyMessageWithExtensions.hs\"], isGroup = False, fields = fromList [], keys = fromList [], extRanges = [(FieldId {getFieldId = 1},FieldId {getFieldId = 18999}),(FieldId {getFieldId = 20000},FieldId {getFieldId = 536870911})], knownKeys = fromList []}"
− tests/UnittestProto/TestEnumWithDupValue.hs
@@ -1,57 +0,0 @@-module UnittestProto.TestEnumWithDupValue (TestEnumWithDupValue(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data TestEnumWithDupValue = FOO1-                          | BAR1-                          | BAZ-                          | FOO2-                          | BAR2-                          deriving (P'.Read, P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestEnumWithDupValue- -instance P'.Bounded TestEnumWithDupValue where-  minBound = FOO1-  maxBound = BAR2- -instance P'.Default TestEnumWithDupValue where-  defaultValue = FOO1- -instance P'.Enum TestEnumWithDupValue where-  fromEnum (FOO1) = 1-  fromEnum (BAR1) = 2-  fromEnum (BAZ) = 3-  fromEnum (FOO2) = 1-  fromEnum (BAR2) = 2-  toEnum 1 = FOO1-  toEnum 2 = BAR1-  toEnum 3 = BAZ-  toEnum 1 = FOO2-  toEnum 2 = BAR2-  succ (FOO1) = BAR1-  succ (BAR1) = BAZ-  succ (BAZ) = FOO2-  succ (FOO2) = BAR2-  pred (BAR1) = FOO1-  pred (BAZ) = BAR1-  pred (FOO2) = BAZ-  pred (BAR2) = FOO2- -instance P'.Wire TestEnumWithDupValue where-  wireSize ft' enum = P'.wireSize ft' (P'.fromEnum enum)-  wirePut ft' enum = P'.wirePut ft' (P'.fromEnum enum)-  wireGet 14 = P'.fmap P'.toEnum (P'.wireGet 14)-  wireGet ft' = P'.wireGetErr ft'- -instance P'.GPB TestEnumWithDupValue- -instance P'.MessageAPI msg' (msg' -> TestEnumWithDupValue) TestEnumWithDupValue where-  getVal m' f' = f' m'- -instance P'.ReflectEnum TestEnumWithDupValue where-  reflectEnum = [(1, "FOO1", FOO1), (2, "BAR1", BAR1), (3, "BAZ", BAZ), (1, "FOO2", FOO2), (2, "BAR2", BAR2)]-  reflectEnumInfo _-    = P'.EnumInfo (P'.ProtoName "" "UnittestProto" "TestEnumWithDupValue") ["UnittestProto", "TestEnumWithDupValue.hs"]-        [(1, "FOO1"), (2, "BAR1"), (3, "BAZ"), (1, "FOO2"), (2, "BAR2")]
− tests/UnittestProto/TestExtremeDefaultValues.hs
@@ -1,79 +0,0 @@-module UnittestProto.TestExtremeDefaultValues (TestExtremeDefaultValues(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data TestExtremeDefaultValues = TestExtremeDefaultValues{escaped_bytes :: P'.Maybe P'.ByteString,-                                                         large_uint32 :: P'.Maybe P'.Word32, large_uint64 :: P'.Maybe P'.Word64,-                                                         small_int32 :: P'.Maybe P'.Int32, small_int64 :: P'.Maybe P'.Int64,-                                                         utf8_string :: P'.Maybe P'.Utf8}-                              deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestExtremeDefaultValues where-  mergeEmpty = TestExtremeDefaultValues P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-  mergeAppend (TestExtremeDefaultValues x'1 x'2 x'3 x'4 x'5 x'6) (TestExtremeDefaultValues y'1 y'2 y'3 y'4 y'5 y'6)-    = TestExtremeDefaultValues (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)-        (P'.mergeAppend x'5 y'5)-        (P'.mergeAppend x'6 y'6)- -instance P'.Default TestExtremeDefaultValues where-  defaultValue-    = TestExtremeDefaultValues (P'.Just (P'.pack "\NUL\SOH\a\b\f\n\r\t\v\\'\"\254")) (P'.Just 4294967295)-        (P'.Just 18446744073709551615)-        (P'.Just (-2147483647))-        (P'.Just (-9223372036854775807))-        (P'.Just (P'.Utf8 (P'.pack "\225\136\180")))- -instance P'.Wire TestExtremeDefaultValues where-  wireSize ft' self'@(TestExtremeDefaultValues x'1 x'2 x'3 x'4 x'5 x'6)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size-          = (P'.wireSizeOpt 1 12 x'1 + P'.wireSizeOpt 1 13 x'2 + P'.wireSizeOpt 1 4 x'3 + P'.wireSizeOpt 1 5 x'4 +-               P'.wireSizeOpt 1 3 x'5-               + P'.wireSizeOpt 1 9 x'6)-  wirePut ft' self'@(TestExtremeDefaultValues x'1 x'2 x'3 x'4 x'5 x'6)-    = 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 10 12 x'1-              P'.wirePutOpt 16 13 x'2-              P'.wirePutOpt 24 4 x'3-              P'.wirePutOpt 32 5 x'4-              P'.wirePutOpt 40 3 x'5-              P'.wirePutOpt 50 9 x'6-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{escaped_bytes = P'.Just new'Field}) (P'.wireGet 12)-              2 -> P'.fmap (\ new'Field -> old'Self{large_uint32 = P'.Just new'Field}) (P'.wireGet 13)-              3 -> P'.fmap (\ new'Field -> old'Self{large_uint64 = P'.Just new'Field}) (P'.wireGet 4)-              4 -> P'.fmap (\ new'Field -> old'Self{small_int32 = P'.Just new'Field}) (P'.wireGet 5)-              5 -> P'.fmap (\ new'Field -> old'Self{small_int64 = P'.Just new'Field}) (P'.wireGet 3)-              6 -> P'.fmap (\ new'Field -> old'Self{utf8_string = P'.Just new'Field}) (P'.wireGet 9)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestExtremeDefaultValues) TestExtremeDefaultValues where-  getVal m' f' = f' m'- -instance P'.GPB TestExtremeDefaultValues- -instance P'.ReflectDescriptor TestExtremeDefaultValues where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestExtremeDefaultValues\"}, descFilePath = [\"UnittestProto\",\"TestExtremeDefaultValues.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestExtremeDefaultValues\", baseName = \"escaped_bytes\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 12}, typeName = Nothing, hsRawDefault = Just (Chunk \"\\NUL\\SOH\\a\\b\\f\\n\\r\\t\\v\\\\'\\\"\\254\" Empty), hsDefault = Just (HsDef'ByteString (Chunk \"\\NUL\\SOH\\a\\b\\f\\n\\r\\t\\v\\\\'\\\"\\254\" Empty))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestExtremeDefaultValues\", baseName = \"large_uint32\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 13}, typeName = Nothing, hsRawDefault = Just (Chunk \"4294967295\" Empty), hsDefault = Just (HsDef'Integer 4294967295)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestExtremeDefaultValues\", baseName = \"large_uint64\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 4}, typeName = Nothing, hsRawDefault = Just (Chunk \"18446744073709551615\" Empty), hsDefault = Just (HsDef'Integer 18446744073709551615)},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestExtremeDefaultValues\", baseName = \"small_int32\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Just (Chunk \"-2147483647\" Empty), hsDefault = Just (HsDef'Integer (-2147483647))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestExtremeDefaultValues\", baseName = \"small_int64\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 40}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 3}, typeName = Nothing, hsRawDefault = Just (Chunk \"-9223372036854775807\" Empty), hsDefault = Just (HsDef'Integer (-9223372036854775807))},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestExtremeDefaultValues\", baseName = \"utf8_string\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 50}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Just (Chunk \"\\225\\136\\180\" Empty), hsDefault = Just (HsDef'ByteString (Chunk \"\\225\\136\\180\" Empty))}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestFieldOrderings.hs
@@ -1,70 +0,0 @@-module UnittestProto.TestFieldOrderings (TestFieldOrderings(..)) where-import Prelude ((+), (<=), (&&), ( || ))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified UnittestProto as UnittestProto (my_extension_int, my_extension_string)- -data TestFieldOrderings = TestFieldOrderings{my_string :: P'.Maybe P'.Utf8, my_int :: P'.Maybe P'.Int64,-                                             my_float :: P'.Maybe P'.Float, ext'field :: P'.ExtField}-                        deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.ExtendMessage TestFieldOrderings where-  getExtField = ext'field-  putExtField e'f msg = msg{ext'field = e'f}-  validExtRanges msg = P'.extRanges (P'.reflectDescriptorInfo msg)- -instance P'.Mergeable TestFieldOrderings where-  mergeEmpty = TestFieldOrderings P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-  mergeAppend (TestFieldOrderings x'1 x'2 x'3 x'4) (TestFieldOrderings y'1 y'2 y'3 y'4)-    = TestFieldOrderings (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)- -instance P'.Default TestFieldOrderings where-  defaultValue = TestFieldOrderings P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue- -instance P'.Wire TestFieldOrderings where-  wireSize ft' self'@(TestFieldOrderings x'1 x'2 x'3 x'4)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 9 x'1 + P'.wireSizeOpt 1 3 x'2 + P'.wireSizeOpt 2 2 x'3 + P'.wireSizeExtField x'4)-  wirePut ft' self'@(TestFieldOrderings x'1 x'2 x'3 x'4)-    = 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 8 3 x'2-              P'.wirePutOpt 90 9 x'1-              P'.wirePutOpt 813 2 x'3-              P'.wirePutExtField x'4-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessageExt update'Self-        11 -> P'.getMessageExt update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              11 -> P'.fmap (\ new'Field -> old'Self{my_string = P'.Just new'Field}) (P'.wireGet 9)-              1 -> P'.fmap (\ new'Field -> old'Self{my_int = P'.Just new'Field}) (P'.wireGet 3)-              101 -> P'.fmap (\ new'Field -> old'Self{my_float = P'.Just new'Field}) (P'.wireGet 2)-              5 -> P'.wireGetKey UnittestProto.my_extension_int old'Self-              50 -> P'.wireGetKey UnittestProto.my_extension_string old'Self-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestFieldOrderings) TestFieldOrderings where-  getVal m' f' = f' m'- -instance P'.GPB TestFieldOrderings- -instance P'.ReflectDescriptor TestFieldOrderings where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestFieldOrderings\"}, descFilePath = [\"UnittestProto\",\"TestFieldOrderings.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestFieldOrderings\", baseName = \"my_string\"}, fieldNumber = FieldId {getFieldId = 11}, wireTag = WireTag {getWireTag = 90}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestFieldOrderings\", baseName = \"my_int\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 3}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestFieldOrderings\", baseName = \"my_float\"}, fieldNumber = FieldId {getFieldId = 101}, wireTag = WireTag {getWireTag = 813}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 2}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [(FieldId {getFieldId = 2},FieldId {getFieldId = 10}),(FieldId {getFieldId = 12},FieldId {getFieldId = 100})], knownKeys = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"my_extension_int\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 40}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"my_extension_string\"}, fieldNumber = FieldId {getFieldId = 50}, wireTag = WireTag {getWireTag = 402}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 9}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}]}"
− tests/UnittestProto/TestForeignNested.hs
@@ -1,57 +0,0 @@-module UnittestProto.TestForeignNested (TestForeignNested(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified UnittestProto.TestAllTypes.NestedMessage as UnittestProto.TestAllTypes (NestedMessage)- -data TestForeignNested = TestForeignNested{foreign_nested :: P'.Maybe UnittestProto.TestAllTypes.NestedMessage}-                       deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestForeignNested where-  mergeEmpty = TestForeignNested P'.mergeEmpty-  mergeAppend (TestForeignNested x'1) (TestForeignNested y'1) = TestForeignNested (P'.mergeAppend x'1 y'1)- -instance P'.Default TestForeignNested where-  defaultValue = TestForeignNested P'.defaultValue- -instance P'.Wire TestForeignNested where-  wireSize ft' self'@(TestForeignNested x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 11 x'1)-  wirePut ft' self'@(TestForeignNested 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 10 11 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{foreign_nested = P'.mergeAppend (foreign_nested old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestForeignNested) TestForeignNested where-  getVal m' f' = f' m'- -instance P'.GPB TestForeignNested- -instance P'.ReflectDescriptor TestForeignNested where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestForeignNested\"}, descFilePath = [\"UnittestProto\",\"TestForeignNested.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestForeignNested\", baseName = \"foreign_nested\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestAllTypes\", baseName = \"NestedMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestMutualRecursionA.hs
@@ -1,56 +0,0 @@-module UnittestProto.TestMutualRecursionA (TestMutualRecursionA(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified UnittestProto.TestMutualRecursionB as UnittestProto (TestMutualRecursionB)- -data TestMutualRecursionA = TestMutualRecursionA{bb :: P'.Maybe UnittestProto.TestMutualRecursionB}-                          deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestMutualRecursionA where-  mergeEmpty = TestMutualRecursionA P'.mergeEmpty-  mergeAppend (TestMutualRecursionA x'1) (TestMutualRecursionA y'1) = TestMutualRecursionA (P'.mergeAppend x'1 y'1)- -instance P'.Default TestMutualRecursionA where-  defaultValue = TestMutualRecursionA P'.defaultValue- -instance P'.Wire TestMutualRecursionA where-  wireSize ft' self'@(TestMutualRecursionA x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 11 x'1)-  wirePut ft' self'@(TestMutualRecursionA 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 10 11 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{bb = P'.mergeAppend (bb old'Self) (P'.Just new'Field)}) (P'.wireGet 11)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestMutualRecursionA) TestMutualRecursionA where-  getVal m' f' = f' m'- -instance P'.GPB TestMutualRecursionA- -instance P'.ReflectDescriptor TestMutualRecursionA where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestMutualRecursionA\"}, descFilePath = [\"UnittestProto\",\"TestMutualRecursionA.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestMutualRecursionA\", baseName = \"bb\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestMutualRecursionB\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestMutualRecursionB.hs
@@ -1,60 +0,0 @@-module UnittestProto.TestMutualRecursionB (TestMutualRecursionB(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import {-# SOURCE #-} qualified UnittestProto.TestMutualRecursionA as UnittestProto (TestMutualRecursionA)- -data TestMutualRecursionB = TestMutualRecursionB{a :: P'.Maybe UnittestProto.TestMutualRecursionA,-                                                 optional_int32 :: P'.Maybe P'.Int32}-                          deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestMutualRecursionB where-  mergeEmpty = TestMutualRecursionB P'.mergeEmpty P'.mergeEmpty-  mergeAppend (TestMutualRecursionB x'1 x'2) (TestMutualRecursionB y'1 y'2)-    = TestMutualRecursionB (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)- -instance P'.Default TestMutualRecursionB where-  defaultValue = TestMutualRecursionB P'.defaultValue P'.defaultValue- -instance P'.Wire TestMutualRecursionB where-  wireSize ft' self'@(TestMutualRecursionB x'1 x'2)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 11 x'1 + P'.wireSizeOpt 1 5 x'2)-  wirePut ft' self'@(TestMutualRecursionB x'1 x'2)-    = 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 10 11 x'1-              P'.wirePutOpt 16 5 x'2-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{a = P'.mergeAppend (a old'Self) (P'.Just new'Field)}) (P'.wireGet 11)-              2 -> P'.fmap (\ new'Field -> old'Self{optional_int32 = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestMutualRecursionB) TestMutualRecursionB where-  getVal m' f' = f' m'- -instance P'.GPB TestMutualRecursionB- -instance P'.ReflectDescriptor TestMutualRecursionB where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestMutualRecursionB\"}, descFilePath = [\"UnittestProto\",\"TestMutualRecursionB.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestMutualRecursionB\", baseName = \"a\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestMutualRecursionA\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestMutualRecursionB\", baseName = \"optional_int32\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestNestedMessageHasBits.hs
@@ -1,60 +0,0 @@-module UnittestProto.TestNestedMessageHasBits (TestNestedMessageHasBits(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified UnittestProto.TestNestedMessageHasBits.NestedMessage as UnittestProto.TestNestedMessageHasBits (NestedMessage)- -data TestNestedMessageHasBits = TestNestedMessageHasBits{optional_nested_message ::-                                                         P'.Maybe UnittestProto.TestNestedMessageHasBits.NestedMessage}-                              deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestNestedMessageHasBits where-  mergeEmpty = TestNestedMessageHasBits P'.mergeEmpty-  mergeAppend (TestNestedMessageHasBits x'1) (TestNestedMessageHasBits y'1) = TestNestedMessageHasBits (P'.mergeAppend x'1 y'1)- -instance P'.Default TestNestedMessageHasBits where-  defaultValue = TestNestedMessageHasBits P'.defaultValue- -instance P'.Wire TestNestedMessageHasBits where-  wireSize ft' self'@(TestNestedMessageHasBits x'1)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 11 x'1)-  wirePut ft' self'@(TestNestedMessageHasBits 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 10 11 x'1-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap-                     (\ new'Field ->-                        old'Self{optional_nested_message = P'.mergeAppend (optional_nested_message old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestNestedMessageHasBits) TestNestedMessageHasBits where-  getVal m' f' = f' m'- -instance P'.GPB TestNestedMessageHasBits- -instance P'.ReflectDescriptor TestNestedMessageHasBits where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestNestedMessageHasBits\"}, descFilePath = [\"UnittestProto\",\"TestNestedMessageHasBits.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestNestedMessageHasBits\", baseName = \"optional_nested_message\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestNestedMessageHasBits\", baseName = \"NestedMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestNestedMessageHasBits/NestedMessage.hs
@@ -1,66 +0,0 @@-module UnittestProto.TestNestedMessageHasBits.NestedMessage (NestedMessage(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified UnittestProto.ForeignMessage as UnittestProto (ForeignMessage)- -data NestedMessage = NestedMessage{nestedmessage_repeated_int32 :: P'.Seq P'.Int32,-                                   nestedmessage_repeated_foreignmessage :: P'.Seq UnittestProto.ForeignMessage}-                   deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable NestedMessage where-  mergeEmpty = NestedMessage P'.mergeEmpty P'.mergeEmpty-  mergeAppend (NestedMessage x'1 x'2) (NestedMessage y'1 y'2) = NestedMessage (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)- -instance P'.Default NestedMessage where-  defaultValue = NestedMessage P'.defaultValue P'.defaultValue- -instance P'.Wire NestedMessage where-  wireSize ft' self'@(NestedMessage x'1 x'2)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeRep 1 5 x'1 + P'.wireSizeRep 1 11 x'2)-  wirePut ft' self'@(NestedMessage x'1 x'2)-    = 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'.wirePutRep 8 5 x'1-              P'.wirePutRep 18 11 x'2-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap-                     (\ new'Field ->-                        old'Self{nestedmessage_repeated_int32 = P'.append (nestedmessage_repeated_int32 old'Self) new'Field})-                     (P'.wireGet 5)-              2 -> P'.fmap-                     (\ new'Field ->-                        old'Self{nestedmessage_repeated_foreignmessage =-                                   P'.append (nestedmessage_repeated_foreignmessage old'Self) new'Field})-                     (P'.wireGet 11)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> NestedMessage) NestedMessage where-  getVal m' f' = f' m'- -instance P'.GPB NestedMessage- -instance P'.ReflectDescriptor NestedMessage where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestNestedMessageHasBits\", baseName = \"NestedMessage\"}, descFilePath = [\"UnittestProto\",\"TestNestedMessageHasBits\",\"NestedMessage.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestNestedMessageHasBits.NestedMessage\", baseName = \"nestedmessage_repeated_int32\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestNestedMessageHasBits.NestedMessage\", baseName = \"nestedmessage_repeated_foreignmessage\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"ForeignMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestReallyLargeTagNumber.hs
@@ -1,58 +0,0 @@-module UnittestProto.TestReallyLargeTagNumber (TestReallyLargeTagNumber(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data TestReallyLargeTagNumber = TestReallyLargeTagNumber{a :: P'.Maybe P'.Int32, bb :: P'.Maybe P'.Int32}-                              deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestReallyLargeTagNumber where-  mergeEmpty = TestReallyLargeTagNumber P'.mergeEmpty P'.mergeEmpty-  mergeAppend (TestReallyLargeTagNumber x'1 x'2) (TestReallyLargeTagNumber y'1 y'2)-    = TestReallyLargeTagNumber (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)- -instance P'.Default TestReallyLargeTagNumber where-  defaultValue = TestReallyLargeTagNumber P'.defaultValue P'.defaultValue- -instance P'.Wire TestReallyLargeTagNumber where-  wireSize ft' self'@(TestReallyLargeTagNumber x'1 x'2)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 5 x'1 + P'.wireSizeOpt 5 5 x'2)-  wirePut ft' self'@(TestReallyLargeTagNumber x'1 x'2)-    = 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 8 5 x'1-              P'.wirePutOpt 2147483640 5 x'2-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{a = P'.Just new'Field}) (P'.wireGet 5)-              268435455 -> P'.fmap (\ new'Field -> old'Self{bb = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestReallyLargeTagNumber) TestReallyLargeTagNumber where-  getVal m' f' = f' m'- -instance P'.GPB TestReallyLargeTagNumber- -instance P'.ReflectDescriptor TestReallyLargeTagNumber where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestReallyLargeTagNumber\"}, descFilePath = [\"UnittestProto\",\"TestReallyLargeTagNumber.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestReallyLargeTagNumber\", baseName = \"a\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestReallyLargeTagNumber\", baseName = \"bb\"}, fieldNumber = FieldId {getFieldId = 268435455}, wireTag = WireTag {getWireTag = 2147483640}, wireTagLength = 5, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestRecursiveMessage.hs
@@ -1,58 +0,0 @@-module UnittestProto.TestRecursiveMessage (TestRecursiveMessage(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data TestRecursiveMessage = TestRecursiveMessage{a :: P'.Maybe TestRecursiveMessage, i :: P'.Maybe P'.Int32}-                          deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestRecursiveMessage where-  mergeEmpty = TestRecursiveMessage P'.mergeEmpty P'.mergeEmpty-  mergeAppend (TestRecursiveMessage x'1 x'2) (TestRecursiveMessage y'1 y'2)-    = TestRecursiveMessage (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2)- -instance P'.Default TestRecursiveMessage where-  defaultValue = TestRecursiveMessage P'.defaultValue P'.defaultValue- -instance P'.Wire TestRecursiveMessage where-  wireSize ft' self'@(TestRecursiveMessage x'1 x'2)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 11 x'1 + P'.wireSizeOpt 1 5 x'2)-  wirePut ft' self'@(TestRecursiveMessage x'1 x'2)-    = 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 10 11 x'1-              P'.wirePutOpt 16 5 x'2-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{a = P'.mergeAppend (a old'Self) (P'.Just new'Field)}) (P'.wireGet 11)-              2 -> P'.fmap (\ new'Field -> old'Self{i = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestRecursiveMessage) TestRecursiveMessage where-  getVal m' f' = f' m'- -instance P'.GPB TestRecursiveMessage- -instance P'.ReflectDescriptor TestRecursiveMessage where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestRecursiveMessage\"}, descFilePath = [\"UnittestProto\",\"TestRecursiveMessage.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRecursiveMessage\", baseName = \"a\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestRecursiveMessage\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRecursiveMessage\", baseName = \"i\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestRequired.hs
@@ -1,257 +0,0 @@-module UnittestProto.TestRequired (TestRequired(..), single, multi) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import {-# SOURCE #-} qualified UnittestProto.TestAllExtensions as UnittestProto (TestAllExtensions)- -data TestRequired = TestRequired{a :: P'.Int32, dummy2 :: P'.Maybe P'.Int32, b :: P'.Int32, dummy4 :: P'.Maybe P'.Int32,-                                 dummy5 :: P'.Maybe P'.Int32, dummy6 :: P'.Maybe P'.Int32, dummy7 :: P'.Maybe P'.Int32,-                                 dummy8 :: P'.Maybe P'.Int32, dummy9 :: P'.Maybe P'.Int32, dummy10 :: P'.Maybe P'.Int32,-                                 dummy11 :: P'.Maybe P'.Int32, dummy12 :: P'.Maybe P'.Int32, dummy13 :: P'.Maybe P'.Int32,-                                 dummy14 :: P'.Maybe P'.Int32, dummy15 :: P'.Maybe P'.Int32, dummy16 :: P'.Maybe P'.Int32,-                                 dummy17 :: P'.Maybe P'.Int32, dummy18 :: P'.Maybe P'.Int32, dummy19 :: P'.Maybe P'.Int32,-                                 dummy20 :: P'.Maybe P'.Int32, dummy21 :: P'.Maybe P'.Int32, dummy22 :: P'.Maybe P'.Int32,-                                 dummy23 :: P'.Maybe P'.Int32, dummy24 :: P'.Maybe P'.Int32, dummy25 :: P'.Maybe P'.Int32,-                                 dummy26 :: P'.Maybe P'.Int32, dummy27 :: P'.Maybe P'.Int32, dummy28 :: P'.Maybe P'.Int32,-                                 dummy29 :: P'.Maybe P'.Int32, dummy30 :: P'.Maybe P'.Int32, dummy31 :: P'.Maybe P'.Int32,-                                 dummy32 :: P'.Maybe P'.Int32, c :: P'.Int32}-                  deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -single :: P'.Key P'.Maybe UnittestProto.TestAllExtensions TestRequired-single = P'.Key 1000 11 P'.Nothing- -multi :: P'.Key P'.Seq UnittestProto.TestAllExtensions TestRequired-multi = P'.Key 1001 11 P'.Nothing- -instance P'.Mergeable TestRequired where-  mergeEmpty-    = TestRequired P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-        P'.mergeEmpty-  mergeAppend-    (TestRequired x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12 x'13 x'14 x'15 x'16 x'17 x'18 x'19 x'20 x'21 x'22 x'23 x'24-       x'25 x'26 x'27 x'28 x'29 x'30 x'31 x'32 x'33)-    (TestRequired y'1 y'2 y'3 y'4 y'5 y'6 y'7 y'8 y'9 y'10 y'11 y'12 y'13 y'14 y'15 y'16 y'17 y'18 y'19 y'20 y'21 y'22 y'23 y'24-       y'25 y'26 y'27 y'28 y'29 y'30 y'31 y'32 y'33)-    = TestRequired (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3) (P'.mergeAppend x'4 y'4)-        (P'.mergeAppend x'5 y'5)-        (P'.mergeAppend x'6 y'6)-        (P'.mergeAppend x'7 y'7)-        (P'.mergeAppend x'8 y'8)-        (P'.mergeAppend x'9 y'9)-        (P'.mergeAppend x'10 y'10)-        (P'.mergeAppend x'11 y'11)-        (P'.mergeAppend x'12 y'12)-        (P'.mergeAppend x'13 y'13)-        (P'.mergeAppend x'14 y'14)-        (P'.mergeAppend x'15 y'15)-        (P'.mergeAppend x'16 y'16)-        (P'.mergeAppend x'17 y'17)-        (P'.mergeAppend x'18 y'18)-        (P'.mergeAppend x'19 y'19)-        (P'.mergeAppend x'20 y'20)-        (P'.mergeAppend x'21 y'21)-        (P'.mergeAppend x'22 y'22)-        (P'.mergeAppend x'23 y'23)-        (P'.mergeAppend x'24 y'24)-        (P'.mergeAppend x'25 y'25)-        (P'.mergeAppend x'26 y'26)-        (P'.mergeAppend x'27 y'27)-        (P'.mergeAppend x'28 y'28)-        (P'.mergeAppend x'29 y'29)-        (P'.mergeAppend x'30 y'30)-        (P'.mergeAppend x'31 y'31)-        (P'.mergeAppend x'32 y'32)-        (P'.mergeAppend x'33 y'33)- -instance P'.Default TestRequired where-  defaultValue-    = TestRequired P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue-        P'.defaultValue- -instance P'.Wire TestRequired where-  wireSize ft'-    self'@(TestRequired x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12 x'13 x'14 x'15 x'16 x'17 x'18 x'19 x'20 x'21 x'22 x'23-             x'24 x'25 x'26 x'27 x'28 x'29 x'30 x'31 x'32 x'33)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size-          = (P'.wireSizeReq 1 5 x'1 + P'.wireSizeOpt 1 5 x'2 + P'.wireSizeReq 1 5 x'3 + P'.wireSizeOpt 1 5 x'4 +-               P'.wireSizeOpt 1 5 x'5-               + P'.wireSizeOpt 1 5 x'6-               + P'.wireSizeOpt 1 5 x'7-               + P'.wireSizeOpt 1 5 x'8-               + P'.wireSizeOpt 1 5 x'9-               + P'.wireSizeOpt 1 5 x'10-               + P'.wireSizeOpt 1 5 x'11-               + P'.wireSizeOpt 1 5 x'12-               + P'.wireSizeOpt 1 5 x'13-               + P'.wireSizeOpt 1 5 x'14-               + P'.wireSizeOpt 1 5 x'15-               + P'.wireSizeOpt 2 5 x'16-               + P'.wireSizeOpt 2 5 x'17-               + P'.wireSizeOpt 2 5 x'18-               + P'.wireSizeOpt 2 5 x'19-               + P'.wireSizeOpt 2 5 x'20-               + P'.wireSizeOpt 2 5 x'21-               + P'.wireSizeOpt 2 5 x'22-               + P'.wireSizeOpt 2 5 x'23-               + P'.wireSizeOpt 2 5 x'24-               + P'.wireSizeOpt 2 5 x'25-               + P'.wireSizeOpt 2 5 x'26-               + P'.wireSizeOpt 2 5 x'27-               + P'.wireSizeOpt 2 5 x'28-               + P'.wireSizeOpt 2 5 x'29-               + P'.wireSizeOpt 2 5 x'30-               + P'.wireSizeOpt 2 5 x'31-               + P'.wireSizeOpt 2 5 x'32-               + P'.wireSizeReq 2 5 x'33)-  wirePut ft'-    self'@(TestRequired x'1 x'2 x'3 x'4 x'5 x'6 x'7 x'8 x'9 x'10 x'11 x'12 x'13 x'14 x'15 x'16 x'17 x'18 x'19 x'20 x'21 x'22 x'23-             x'24 x'25 x'26 x'27 x'28 x'29 x'30 x'31 x'32 x'33)-    = 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'.wirePutReq 8 5 x'1-              P'.wirePutOpt 16 5 x'2-              P'.wirePutReq 24 5 x'3-              P'.wirePutOpt 32 5 x'4-              P'.wirePutOpt 40 5 x'5-              P'.wirePutOpt 48 5 x'6-              P'.wirePutOpt 56 5 x'7-              P'.wirePutOpt 64 5 x'8-              P'.wirePutOpt 72 5 x'9-              P'.wirePutOpt 80 5 x'10-              P'.wirePutOpt 88 5 x'11-              P'.wirePutOpt 96 5 x'12-              P'.wirePutOpt 104 5 x'13-              P'.wirePutOpt 112 5 x'14-              P'.wirePutOpt 120 5 x'15-              P'.wirePutOpt 128 5 x'16-              P'.wirePutOpt 136 5 x'17-              P'.wirePutOpt 144 5 x'18-              P'.wirePutOpt 152 5 x'19-              P'.wirePutOpt 160 5 x'20-              P'.wirePutOpt 168 5 x'21-              P'.wirePutOpt 176 5 x'22-              P'.wirePutOpt 184 5 x'23-              P'.wirePutOpt 192 5 x'24-              P'.wirePutOpt 200 5 x'25-              P'.wirePutOpt 208 5 x'26-              P'.wirePutOpt 216 5 x'27-              P'.wirePutOpt 224 5 x'28-              P'.wirePutOpt 232 5 x'29-              P'.wirePutOpt 240 5 x'30-              P'.wirePutOpt 248 5 x'31-              P'.wirePutOpt 256 5 x'32-              P'.wirePutReq 264 5 x'33-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap (\ new'Field -> old'Self{a = new'Field}) (P'.wireGet 5)-              2 -> P'.fmap (\ new'Field -> old'Self{dummy2 = P'.Just new'Field}) (P'.wireGet 5)-              3 -> P'.fmap (\ new'Field -> old'Self{b = new'Field}) (P'.wireGet 5)-              4 -> P'.fmap (\ new'Field -> old'Self{dummy4 = P'.Just new'Field}) (P'.wireGet 5)-              5 -> P'.fmap (\ new'Field -> old'Self{dummy5 = P'.Just new'Field}) (P'.wireGet 5)-              6 -> P'.fmap (\ new'Field -> old'Self{dummy6 = P'.Just new'Field}) (P'.wireGet 5)-              7 -> P'.fmap (\ new'Field -> old'Self{dummy7 = P'.Just new'Field}) (P'.wireGet 5)-              8 -> P'.fmap (\ new'Field -> old'Self{dummy8 = P'.Just new'Field}) (P'.wireGet 5)-              9 -> P'.fmap (\ new'Field -> old'Self{dummy9 = P'.Just new'Field}) (P'.wireGet 5)-              10 -> P'.fmap (\ new'Field -> old'Self{dummy10 = P'.Just new'Field}) (P'.wireGet 5)-              11 -> P'.fmap (\ new'Field -> old'Self{dummy11 = P'.Just new'Field}) (P'.wireGet 5)-              12 -> P'.fmap (\ new'Field -> old'Self{dummy12 = P'.Just new'Field}) (P'.wireGet 5)-              13 -> P'.fmap (\ new'Field -> old'Self{dummy13 = P'.Just new'Field}) (P'.wireGet 5)-              14 -> P'.fmap (\ new'Field -> old'Self{dummy14 = P'.Just new'Field}) (P'.wireGet 5)-              15 -> P'.fmap (\ new'Field -> old'Self{dummy15 = P'.Just new'Field}) (P'.wireGet 5)-              16 -> P'.fmap (\ new'Field -> old'Self{dummy16 = P'.Just new'Field}) (P'.wireGet 5)-              17 -> P'.fmap (\ new'Field -> old'Self{dummy17 = P'.Just new'Field}) (P'.wireGet 5)-              18 -> P'.fmap (\ new'Field -> old'Self{dummy18 = P'.Just new'Field}) (P'.wireGet 5)-              19 -> P'.fmap (\ new'Field -> old'Self{dummy19 = P'.Just new'Field}) (P'.wireGet 5)-              20 -> P'.fmap (\ new'Field -> old'Self{dummy20 = P'.Just new'Field}) (P'.wireGet 5)-              21 -> P'.fmap (\ new'Field -> old'Self{dummy21 = P'.Just new'Field}) (P'.wireGet 5)-              22 -> P'.fmap (\ new'Field -> old'Self{dummy22 = P'.Just new'Field}) (P'.wireGet 5)-              23 -> P'.fmap (\ new'Field -> old'Self{dummy23 = P'.Just new'Field}) (P'.wireGet 5)-              24 -> P'.fmap (\ new'Field -> old'Self{dummy24 = P'.Just new'Field}) (P'.wireGet 5)-              25 -> P'.fmap (\ new'Field -> old'Self{dummy25 = P'.Just new'Field}) (P'.wireGet 5)-              26 -> P'.fmap (\ new'Field -> old'Self{dummy26 = P'.Just new'Field}) (P'.wireGet 5)-              27 -> P'.fmap (\ new'Field -> old'Self{dummy27 = P'.Just new'Field}) (P'.wireGet 5)-              28 -> P'.fmap (\ new'Field -> old'Self{dummy28 = P'.Just new'Field}) (P'.wireGet 5)-              29 -> P'.fmap (\ new'Field -> old'Self{dummy29 = P'.Just new'Field}) (P'.wireGet 5)-              30 -> P'.fmap (\ new'Field -> old'Self{dummy30 = P'.Just new'Field}) (P'.wireGet 5)-              31 -> P'.fmap (\ new'Field -> old'Self{dummy31 = P'.Just new'Field}) (P'.wireGet 5)-              32 -> P'.fmap (\ new'Field -> old'Self{dummy32 = P'.Just new'Field}) (P'.wireGet 5)-              33 -> P'.fmap (\ new'Field -> old'Self{c = new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestRequired) TestRequired where-  getVal m' f' = f' m'- -instance P'.GPB TestRequired- -instance P'.ReflectDescriptor TestRequired where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestRequired\"}, descFilePath = [\"UnittestProto\",\"TestRequired.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"a\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 8}, wireTagLength = 1, isRequired = True, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy2\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 16}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"b\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, wireTagLength = 1, isRequired = True, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy4\"}, fieldNumber = FieldId {getFieldId = 4}, wireTag = WireTag {getWireTag = 32}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy5\"}, fieldNumber = FieldId {getFieldId = 5}, wireTag = WireTag {getWireTag = 40}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy6\"}, fieldNumber = FieldId {getFieldId = 6}, wireTag = WireTag {getWireTag = 48}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy7\"}, fieldNumber = FieldId {getFieldId = 7}, wireTag = WireTag {getWireTag = 56}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy8\"}, fieldNumber = FieldId {getFieldId = 8}, wireTag = WireTag {getWireTag = 64}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy9\"}, fieldNumber = FieldId {getFieldId = 9}, wireTag = WireTag {getWireTag = 72}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy10\"}, fieldNumber = FieldId {getFieldId = 10}, wireTag = WireTag {getWireTag = 80}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy11\"}, fieldNumber = FieldId {getFieldId = 11}, wireTag = WireTag {getWireTag = 88}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy12\"}, fieldNumber = FieldId {getFieldId = 12}, wireTag = WireTag {getWireTag = 96}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy13\"}, fieldNumber = FieldId {getFieldId = 13}, wireTag = WireTag {getWireTag = 104}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy14\"}, fieldNumber = FieldId {getFieldId = 14}, wireTag = WireTag {getWireTag = 112}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy15\"}, fieldNumber = FieldId {getFieldId = 15}, wireTag = WireTag {getWireTag = 120}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy16\"}, fieldNumber = FieldId {getFieldId = 16}, wireTag = WireTag {getWireTag = 128}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy17\"}, fieldNumber = FieldId {getFieldId = 17}, wireTag = WireTag {getWireTag = 136}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy18\"}, fieldNumber = FieldId {getFieldId = 18}, wireTag = WireTag {getWireTag = 144}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy19\"}, fieldNumber = FieldId {getFieldId = 19}, wireTag = WireTag {getWireTag = 152}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy20\"}, fieldNumber = FieldId {getFieldId = 20}, wireTag = WireTag {getWireTag = 160}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy21\"}, fieldNumber = FieldId {getFieldId = 21}, wireTag = WireTag {getWireTag = 168}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy22\"}, fieldNumber = FieldId {getFieldId = 22}, wireTag = WireTag {getWireTag = 176}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy23\"}, fieldNumber = FieldId {getFieldId = 23}, wireTag = WireTag {getWireTag = 184}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy24\"}, fieldNumber = FieldId {getFieldId = 24}, wireTag = WireTag {getWireTag = 192}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy25\"}, fieldNumber = FieldId {getFieldId = 25}, wireTag = WireTag {getWireTag = 200}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy26\"}, fieldNumber = FieldId {getFieldId = 26}, wireTag = WireTag {getWireTag = 208}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy27\"}, fieldNumber = FieldId {getFieldId = 27}, wireTag = WireTag {getWireTag = 216}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy28\"}, fieldNumber = FieldId {getFieldId = 28}, wireTag = WireTag {getWireTag = 224}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy29\"}, fieldNumber = FieldId {getFieldId = 29}, wireTag = WireTag {getWireTag = 232}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy30\"}, fieldNumber = FieldId {getFieldId = 30}, wireTag = WireTag {getWireTag = 240}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy31\"}, fieldNumber = FieldId {getFieldId = 31}, wireTag = WireTag {getWireTag = 248}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"dummy32\"}, fieldNumber = FieldId {getFieldId = 32}, wireTag = WireTag {getWireTag = 256}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"c\"}, fieldNumber = FieldId {getFieldId = 33}, wireTag = WireTag {getWireTag = 264}, wireTagLength = 2, isRequired = True, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [(ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestAllExtensions\"},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"single\"}, fieldNumber = FieldId {getFieldId = 1000}, wireTag = WireTag {getWireTag = 8002}, wireTagLength = 2, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestRequired\"}), hsRawDefault = Nothing, hsDefault = Nothing}),(ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestAllExtensions\"},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequired\", baseName = \"multi\"}, fieldNumber = FieldId {getFieldId = 1001}, wireTag = WireTag {getWireTag = 8010}, wireTagLength = 2, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestRequired\"}), hsRawDefault = Nothing, hsDefault = Nothing})], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestRequiredForeign.hs
@@ -1,65 +0,0 @@-module UnittestProto.TestRequiredForeign (TestRequiredForeign(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'-import qualified UnittestProto.TestRequired as UnittestProto (TestRequired)- -data TestRequiredForeign = TestRequiredForeign{optional_message :: P'.Maybe UnittestProto.TestRequired,-                                               repeated_message :: P'.Seq UnittestProto.TestRequired, dummy :: P'.Maybe P'.Int32}-                         deriving (P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestRequiredForeign where-  mergeEmpty = TestRequiredForeign P'.mergeEmpty P'.mergeEmpty P'.mergeEmpty-  mergeAppend (TestRequiredForeign x'1 x'2 x'3) (TestRequiredForeign y'1 y'2 y'3)-    = TestRequiredForeign (P'.mergeAppend x'1 y'1) (P'.mergeAppend x'2 y'2) (P'.mergeAppend x'3 y'3)- -instance P'.Default TestRequiredForeign where-  defaultValue = TestRequiredForeign P'.defaultValue P'.defaultValue P'.defaultValue- -instance P'.Wire TestRequiredForeign where-  wireSize ft' self'@(TestRequiredForeign x'1 x'2 x'3)-    = case ft' of-        10 -> calc'Size-        11 -> P'.prependMessageSize calc'Size-        _ -> P'.wireSizeErr ft' self'-    where-        calc'Size = (P'.wireSizeOpt 1 11 x'1 + P'.wireSizeRep 1 11 x'2 + P'.wireSizeOpt 1 5 x'3)-  wirePut ft' self'@(TestRequiredForeign x'1 x'2 x'3)-    = 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 10 11 x'1-              P'.wirePutRep 18 11 x'2-              P'.wirePutOpt 24 5 x'3-  wireGet ft'-    = case ft' of-        10 -> P'.getBareMessage update'Self-        11 -> P'.getMessage update'Self-        _ -> P'.wireGetErr ft'-    where-        update'Self field'Number old'Self-          = case field'Number of-              1 -> P'.fmap-                     (\ new'Field -> old'Self{optional_message = P'.mergeAppend (optional_message old'Self) (P'.Just new'Field)})-                     (P'.wireGet 11)-              2 -> P'.fmap (\ new'Field -> old'Self{repeated_message = P'.append (repeated_message old'Self) new'Field})-                     (P'.wireGet 11)-              3 -> P'.fmap (\ new'Field -> old'Self{dummy = P'.Just new'Field}) (P'.wireGet 5)-              _ -> P'.unknownField field'Number- -instance P'.MessageAPI msg' (msg' -> TestRequiredForeign) TestRequiredForeign where-  getVal m' f' = f' m'- -instance P'.GPB TestRequiredForeign- -instance P'.ReflectDescriptor TestRequiredForeign where-  reflectDescriptorInfo _-    = P'.read-        "DescriptorInfo {descName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestRequiredForeign\"}, descFilePath = [\"UnittestProto\",\"TestRequiredForeign.hs\"], isGroup = False, fields = fromList [FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequiredForeign\", baseName = \"optional_message\"}, fieldNumber = FieldId {getFieldId = 1}, wireTag = WireTag {getWireTag = 10}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestRequired\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequiredForeign\", baseName = \"repeated_message\"}, fieldNumber = FieldId {getFieldId = 2}, wireTag = WireTag {getWireTag = 18}, wireTagLength = 1, isRequired = False, canRepeat = True, typeCode = FieldType {getFieldType = 11}, typeName = Just (ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto\", baseName = \"TestRequired\"}), hsRawDefault = Nothing, hsDefault = Nothing},FieldInfo {fieldName = ProtoName {haskellPrefix = \"\", parentModule = \"UnittestProto.TestRequiredForeign\", baseName = \"dummy\"}, fieldNumber = FieldId {getFieldId = 3}, wireTag = WireTag {getWireTag = 24}, wireTagLength = 1, isRequired = False, canRepeat = False, typeCode = FieldType {getFieldType = 5}, typeName = Nothing, hsRawDefault = Nothing, hsDefault = Nothing}], keys = fromList [], extRanges = [], knownKeys = fromList []}"
− tests/UnittestProto/TestSparseEnum.hs
@@ -1,70 +0,0 @@-module UnittestProto.TestSparseEnum (TestSparseEnum(..)) where-import Prelude ((+))-import qualified Prelude as P'-import qualified Text.ProtocolBuffers.Header as P'- -data TestSparseEnum = SPARSE_A-                    | SPARSE_B-                    | SPARSE_C-                    | SPARSE_D-                    | SPARSE_E-                    | SPARSE_F-                    | SPARSE_G-                    deriving (P'.Read, P'.Show, P'.Eq, P'.Ord, P'.Typeable)- -instance P'.Mergeable TestSparseEnum- -instance P'.Bounded TestSparseEnum where-  minBound = SPARSE_A-  maxBound = SPARSE_G- -instance P'.Default TestSparseEnum where-  defaultValue = SPARSE_A- -instance P'.Enum TestSparseEnum where-  fromEnum (SPARSE_A) = 123-  fromEnum (SPARSE_B) = 62374-  fromEnum (SPARSE_C) = 12589234-  fromEnum (SPARSE_D) = 15-  fromEnum (SPARSE_E) = 53452-  fromEnum (SPARSE_F) = 0-  fromEnum (SPARSE_G) = 2-  toEnum 123 = SPARSE_A-  toEnum 62374 = SPARSE_B-  toEnum 12589234 = SPARSE_C-  toEnum 15 = SPARSE_D-  toEnum 53452 = SPARSE_E-  toEnum 0 = SPARSE_F-  toEnum 2 = SPARSE_G-  succ (SPARSE_A) = SPARSE_B-  succ (SPARSE_B) = SPARSE_C-  succ (SPARSE_C) = SPARSE_D-  succ (SPARSE_D) = SPARSE_E-  succ (SPARSE_E) = SPARSE_F-  succ (SPARSE_F) = SPARSE_G-  pred (SPARSE_B) = SPARSE_A-  pred (SPARSE_C) = SPARSE_B-  pred (SPARSE_D) = SPARSE_C-  pred (SPARSE_E) = SPARSE_D-  pred (SPARSE_F) = SPARSE_E-  pred (SPARSE_G) = SPARSE_F- -instance P'.Wire TestSparseEnum where-  wireSize ft' enum = P'.wireSize ft' (P'.fromEnum enum)-  wirePut ft' enum = P'.wirePut ft' (P'.fromEnum enum)-  wireGet 14 = P'.fmap P'.toEnum (P'.wireGet 14)-  wireGet ft' = P'.wireGetErr ft'- -instance P'.GPB TestSparseEnum- -instance P'.MessageAPI msg' (msg' -> TestSparseEnum) TestSparseEnum where-  getVal m' f' = f' m'- -instance P'.ReflectEnum TestSparseEnum where-  reflectEnum-    = [(123, "SPARSE_A", SPARSE_A), (62374, "SPARSE_B", SPARSE_B), (12589234, "SPARSE_C", SPARSE_C), (15, "SPARSE_D", SPARSE_D),-       (53452, "SPARSE_E", SPARSE_E), (0, "SPARSE_F", SPARSE_F), (2, "SPARSE_G", SPARSE_G)]-  reflectEnumInfo _-    = P'.EnumInfo (P'.ProtoName "" "UnittestProto" "TestSparseEnum") ["UnittestProto", "TestSparseEnum.hs"]-        [(123, "SPARSE_A"), (62374, "SPARSE_B"), (12589234, "SPARSE_C"), (15, "SPARSE_D"), (53452, "SPARSE_E"), (0, "SPARSE_F"),-         (2, "SPARSE_G")]
− tests/google-proto-files/examples/addressbook.proto
@@ -1,30 +0,0 @@-// See README.txt for information and build instructions.--package tutorial;--option java_package = "com.example.tutorial";-option java_outer_classname = "AddressBookProtos";--message Person {-  required string name = 1;-  required int32 id = 2;        // Unique ID number for this person.-  optional string email = 3;--  enum PhoneType {-    MOBILE = 0;-    HOME = 1;-    WORK = 2;-  }--  message PhoneNumber {-    required string number = 1;-    optional PhoneType type = 2 [default = HOME];-  }--  repeated PhoneNumber phone = 4;-}--// Our address book file is just one of these.-message AddressBook {-  repeated Person person = 1;-}
− tests/google-proto-files/java/src/test/java/com/google/protobuf/multiple_file
@@ -1,53 +0,0 @@-// Protocol Buffers - Google's data interchange format-// Copyright 2008 Google Inc.-// http://code.google.com/p/protobuf/-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-//      http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--// Author: kenton@google.com (Kenton Varda)-//-// A proto file which tests the java_multiple_files option.---import "google/protobuf/unittest.proto";--package protobuf_unittest;--option java_multiple_files = true;-option java_outer_classname = "MultipleFilesTestProto";--message MessageWithNoOuter {-  message NestedMessage {-    optional int32 i = 1;-  }-  enum NestedEnum {-    BAZ = 3;-  }-  optional NestedMessage nested = 1;-  repeated TestAllTypes foreign = 2;-  optional NestedEnum nested_enum = 3;-  optional EnumWithNoOuter foreign_enum = 4;-}--enum EnumWithNoOuter {-  FOO = 1;-  BAR = 2;-}--service ServiceWithNoOuter {-  rpc Foo(MessageWithNoOuter) returns(TestAllTypes);-}--extend TestAllExtensions {-  optional int32 extension_with_outer = 1234567;-}
− tests/google-proto-files/python/google/protobuf/internal/more_extensions.prot
@@ -1,44 +0,0 @@-// Protocol Buffers - Google's data interchange format-// Copyright 2008 Google Inc.-// http://code.google.com/p/protobuf/-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-//      http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--// Author: robinson@google.com (Will Robinson)---package google.protobuf.internal;---message TopLevelMessage {-  optional ExtendedMessage submessage = 1;-}---message ExtendedMessage {-  extensions 1 to max;-}---message ForeignMessage {-  optional int32 foreign_message_int = 1;-}---extend ExtendedMessage {-  optional int32 optional_int_extension = 1;-  optional ForeignMessage optional_message_extension = 2;--  repeated int32 repeated_int_extension = 3;-  repeated ForeignMessage repeated_message_extension = 4;-}
− tests/google-proto-files/python/google/protobuf/internal/more_messages.proto
@@ -1,37 +0,0 @@-// Protocol Buffers - Google's data interchange format-// Copyright 2008 Google Inc.-// http://code.google.com/p/protobuf/-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-//      http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--// Author: robinson@google.com (Will Robinson)---package google.protobuf.internal;--// A message where tag numbers are listed out of order, to allow us to test our-// canonicalization of serialized output, which should always be in tag order.-// We also mix in some extensions for extra fun.-message OutOfOrderFields {-  optional   sint32 optional_sint32   =  5;-  extensions 4 to 4;-  optional   uint32 optional_uint32   =  3;-  extensions 2 to 2;-  optional    int32 optional_int32    =  1;-};---extend OutOfOrderFields {-  optional   uint64 optional_uint64   =  4;-  optional    int64 optional_int64    =  2;-}
− tests/google-proto-files/src/google/protobuf/compiler/cpp/cpp_test_bad_identi
@@ -1,87 +0,0 @@-// Protocol Buffers - Google's data interchange format-// Copyright 2008 Google Inc.-// http://code.google.com/p/protobuf/-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-//      http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--// Author: kenton@google.com (Kenton Varda)-//  Based on original Protocol Buffers design by-//  Sanjay Ghemawat, Jeff Dean, and others.-//-// This file tests that various identifiers work as field and type names even-// though the same identifiers are used internally by the C++ code generator.---// We don't put this in a package within proto2 because we need to make sure-// that the generated code doesn't depend on being in the proto2 namespace.-package protobuf_unittest;--// Test that fields can have names like "input" and "i" which are also used-// internally by the code generator for local variables.-message TestConflictingSymbolNames {-  message BuildDescriptors {}-  message TypeTraits {}--  optional int32 input = 1;-  optional int32 output = 2;-  optional string length = 3;-  repeated int32 i = 4;-  repeated string new_element = 5 [ctype=STRING_PIECE];-  optional int32 total_size = 6;-  optional int32 tag = 7;--  optional int32 source = 8;-  optional int32 value = 9;-  optional int32 file = 10;-  optional int32 from = 11;-  optional int32 handle_uninterpreted = 12;-  repeated int32 index = 13;-  optional int32 controller = 14;-  optional int32 already_here = 15;--  optional uint32 uint32 = 16;-  optional uint64 uint64 = 17;-  optional string string = 18;-  optional int32 memset = 19;-  optional int32 int32 = 20;-  optional int64 int64 = 21;--  optional uint32 cached_size = 22;-  optional uint32 extensions = 23;-  optional uint32 bit = 24;-  optional uint32 bits = 25;-  optional uint32 offsets = 26;-  optional uint32 reflection = 27;--  message Cord {}-  optional string some_cord = 28 [ctype=CORD];--  message StringPiece {}-  optional string some_string_piece = 29 [ctype=STRING_PIECE];--  // Some keywords.-  optional uint32 int = 30;-  optional uint32 friend = 31;--  // The generator used to #define a macro called "DO" inside the .cc file.-  message DO {}-  optional DO do = 32;--  extensions 1000 to max;-}--message DummyMessage {}--service TestConflictingMethodNames {-  rpc Closure(DummyMessage) returns (DummyMessage);-}
− tests/google-proto-files/src/google/protobuf/descriptor.proto
@@ -1,286 +0,0 @@-// Protocol Buffers - Google's data interchange format-// Copyright 2008 Google Inc.-// http://code.google.com/p/protobuf/-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-//      http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--// Author: kenton@google.com (Kenton Varda)-//  Based on original Protocol Buffers design by-//  Sanjay Ghemawat, Jeff Dean, and others.-//-// The messages in this file describe the definitions found in .proto files.-// A valid .proto file can be translated directly to a FileDescriptorProto-// without any other information (e.g. without reading its imports).----package google.protobuf;-option java_package = "com.google.protobuf";-option java_outer_classname = "DescriptorProtos";--// descriptor.proto must be optimized for speed because reflection-based-// algorithms don't work during bootstrapping.-option optimize_for = SPEED;--// Describes a complete .proto file.-message FileDescriptorProto {-  optional string name = 1;       // file name, relative to root of source tree-  optional string package = 2;    // e.g. "foo", "foo.bar", etc.--  // Names of files imported by this file.-  repeated string dependency = 3;--  // All top-level definitions in this file.-  repeated DescriptorProto message_type = 4;-  repeated EnumDescriptorProto enum_type = 5;-  repeated ServiceDescriptorProto service = 6;-  repeated FieldDescriptorProto extension = 7;--  optional FileOptions options = 8;-}--// Describes a message type.-message DescriptorProto {-  optional string name = 1;--  repeated FieldDescriptorProto field = 2;-  repeated FieldDescriptorProto extension = 6;--  repeated DescriptorProto nested_type = 3;-  repeated EnumDescriptorProto enum_type = 4;--  message ExtensionRange {-    optional int32 start = 1;-    optional int32 end = 2;-  }-  repeated ExtensionRange extension_range = 5;--  optional MessageOptions options = 7;-}--// Describes a field within a message.-message FieldDescriptorProto {-  enum Type {-    // 0 is reserved for errors.-    // Order is weird for historical reasons.-    TYPE_DOUBLE         = 1;-    TYPE_FLOAT          = 2;-    TYPE_INT64          = 3;   // Not ZigZag encoded.  Negative numbers-                               // take 10 bytes.  Use TYPE_SINT64 if negative-                               // values are likely.-    TYPE_UINT64         = 4;-    TYPE_INT32          = 5;   // Not ZigZag encoded.  Negative numbers-                               // take 10 bytes.  Use TYPE_SINT32 if negative-                               // values are likely.-    TYPE_FIXED64        = 6;-    TYPE_FIXED32        = 7;-    TYPE_BOOL           = 8;-    TYPE_STRING         = 9;-    TYPE_GROUP          = 10;  // Tag-delimited aggregate.-    TYPE_MESSAGE        = 11;  // Length-delimited aggregate.--    // New in version 2.-    TYPE_BYTES          = 12;-    TYPE_UINT32         = 13;-    TYPE_ENUM           = 14;-    TYPE_SFIXED32       = 15;-    TYPE_SFIXED64       = 16;-    TYPE_SINT32         = 17;  // Uses ZigZag encoding.-    TYPE_SINT64         = 18;  // Uses ZigZag encoding.-  };--  enum Label {-    // 0 is reserved for errors-    LABEL_OPTIONAL      = 1;-    LABEL_REQUIRED      = 2;-    LABEL_REPEATED      = 3;-    // TODO(sanjay): Should we add LABEL_MAP?-  };--  optional string name = 1;-  optional int32 number = 3;-  optional Label label = 4;--  // If type_name is set, this need not be set.  If both this and type_name-  // are set, this must be either TYPE_ENUM or TYPE_MESSAGE.-  optional Type type = 5;--  // For message and enum types, this is the name of the type.  If the name-  // starts with a '.', it is fully-qualified.  Otherwise, C++-like scoping-  // rules are used to find the type (i.e. first the nested types within this-  // message are searched, then within the parent, on up to the root-  // namespace).-  optional string type_name = 6;--  // For extensions, this is the name of the type being extended.  It is-  // resolved in the same manner as type_name.-  optional string extendee = 2;--  // For numeric types, contains the original text representation of the value.-  // For booleans, "true" or "false".-  // For strings, contains the default text contents (not escaped in any way).-  // For bytes, contains the C escaped value.  All bytes >= 128 are escaped.-  // TODO(kenton):  Base-64 encode?-  optional string default_value = 7;--  optional FieldOptions options = 8;-}--// Describes an enum type.-message EnumDescriptorProto {-  optional string name = 1;--  repeated EnumValueDescriptorProto value = 2;--  optional EnumOptions options = 3;-}--// Describes a value within an enum.-message EnumValueDescriptorProto {-  optional string name = 1;-  optional int32 number = 2;--  optional EnumValueOptions options = 3;-}--// Describes a service.-message ServiceDescriptorProto {-  optional string name = 1;-  repeated MethodDescriptorProto method = 2;--  optional ServiceOptions options = 3;-}--// Describes a method of a service.-message MethodDescriptorProto {-  optional string name = 1;--  // Input and output type names.  These are resolved in the same way as-  // FieldDescriptorProto.type_name, but must refer to a message type.-  optional string input_type = 2;-  optional string output_type = 3;--  optional MethodOptions options = 4;-}--// ===================================================================-// Options--// Each of the definitions above may have "options" attached.  These are-// just annotations which may cause code to be generated slightly differently-// or may contain hints for code that manipulates protocol messages.--// TODO(kenton):  Allow extensions to options.--message FileOptions {--  // Sets the Java package where classes generated from this .proto will be-  // placed.  By default, the proto package is used, but this is often-  // inappropriate because proto packages do not normally start with backwards-  // domain names.-  optional string java_package = 1;---  // If set, all the classes from the .proto file are wrapped in a single-  // outer class with the given name.  This applies to both Proto1-  // (equivalent to the old "--one_java_file" option) and Proto2 (where-  // a .proto always translates to a single class, but you may want to-  // explicitly choose the class name).-  optional string java_outer_classname = 8;--  // If set true, then the Java code generator will generate a separate .java-  // file for each top-level message, enum, and service defined in the .proto-  // file.  Thus, these types will *not* be nested inside the outer class-  // named by java_outer_classname.  However, the outer class will still be-  // generated to contain the file's getDescriptor() method as well as any-  // top-level extensions defined in the file.-  optional bool java_multiple_files = 10 [default=false];--  // Generated classes can be optimized for speed or code size.-  enum OptimizeMode {-    SPEED = 1;      // Generate complete code for parsing, serialization, etc.-    CODE_SIZE = 2;  // Use ReflectionOps to implement these methods.-  }-  optional OptimizeMode optimize_for = 9 [default=CODE_SIZE];-}--message MessageOptions {-  // Set true to use the old proto1 MessageSet wire format for extensions.-  // This is provided for backwards-compatibility with the MessageSet wire-  // format.  You should not use this for any other reason:  It's less-  // efficient, has fewer features, and is more complicated.-  //-  // The message must be defined exactly as follows:-  //   message Foo {-  //     option message_set_wire_format = true;-  //     extensions 4 to max;-  //   }-  // Note that the message cannot have any defined fields; MessageSets only-  // have extensions.-  //-  // All extensions of your type must be singular messages; e.g. they cannot-  // be int32s, enums, or repeated messages.-  //-  // Because this is an option, the above two restrictions are not enforced by-  // the protocol compiler.-  optional bool message_set_wire_format = 1 [default=false];-}--message FieldOptions {-  // The ctype option instructs the C++ code generator to use a different-  // representation of the field than it normally would.  See the specific-  // options below.  This option is not yet implemented in the open source-  // release -- sorry, we'll try to include it in a future version!-  optional CType ctype = 1;-  enum CType {-    CORD = 1;--    STRING_PIECE = 2;-  }--  // EXPERIMENTAL.  DO NOT USE.-  // For "map" fields, the name of the field in the enclosed type that-  // is the key for this map.  For example, suppose we have:-  //   message Item {-  //     required string name = 1;-  //     required string value = 2;-  //   }-  //   message Config {-  //     repeated Item items = 1 [experimental_map_key="name"];-  //   }-  // In this situation, the map key for Item will be set to "name".-  // TODO: Fully-implement this, then remove the "experimental_" prefix.-  optional string experimental_map_key = 9;-}--message EnumOptions {-}--message EnumValueOptions {-}--message ServiceOptions {--  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC-  //   framework.  We apologize for hoarding these numbers to ourselves, but-  //   we were already using them long before we decided to release Protocol-  //   Buffers.-}--message MethodOptions {--  // Note:  Field numbers 1 through 32 are reserved for Google's internal RPC-  //   framework.  We apologize for hoarding these numbers to ourselves, but-  //   we were already using them long before we decided to release Protocol-  //   Buffers.-}
− tests/google-proto-files/src/google/protobuf/unittest.proto
@@ -1,452 +0,0 @@-// Protocol Buffers - Google's data interchange format-// Copyright 2008 Google Inc.-// http://code.google.com/p/protobuf/-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-//      http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--// Author: kenton@google.com (Kenton Varda)-//  Based on original Protocol Buffers design by-//  Sanjay Ghemawat, Jeff Dean, and others.-//-// A proto file we will use for unit testing.---import "google/protobuf/unittest_import.proto";--// We don't put this in a package within proto2 because we need to make sure-// that the generated code doesn't depend on being in the proto2 namespace.-// In test_util.h we do "using namespace unittest = protobuf_unittest".-package protobuf_unittest;--// Protos optimized for SPEED use a strict superset of the generated code-// of equivalent ones optimized for CODE_SIZE, so we should optimize all our-// tests for speed unless explicitly testing code size optimization.-option optimize_for = SPEED;--option java_outer_classname = "UnittestProto";--// This proto includes every type of field in both singular and repeated-// forms.-message TestAllTypes {-  message NestedMessage {-    // The field name "b" fails to compile in proto1 because it conflicts with-    // a local variable named "b" in one of the generated methods.  Doh.-    // This file needs to compile in proto1 to test backwards-compatibility.-    optional int32 bb = 1;-  }--  enum NestedEnum {-    FOO = 1;-    BAR = 2;-    BAZ = 3;-  }--  // Singular-  optional    int32 optional_int32    =  1;-  optional    int64 optional_int64    =  2;-  optional   uint32 optional_uint32   =  3;-  optional   uint64 optional_uint64   =  4;-  optional   sint32 optional_sint32   =  5;-  optional   sint64 optional_sint64   =  6;-  optional  fixed32 optional_fixed32  =  7;-  optional  fixed64 optional_fixed64  =  8;-  optional sfixed32 optional_sfixed32 =  9;-  optional sfixed64 optional_sfixed64 = 10;-  optional    float optional_float    = 11;-  optional   double optional_double   = 12;-  optional     bool optional_bool     = 13;-  optional   string optional_string   = 14;-  optional    bytes optional_bytes    = 15;--  optional group OptionalGroup = 16 {-    optional int32 a = 17;-  }--  optional NestedMessage                        optional_nested_message  = 18;-  optional ForeignMessage                       optional_foreign_message = 19;-  optional protobuf_unittest_import.ImportMessage optional_import_message  = 20;--  optional NestedEnum                           optional_nested_enum     = 21;-  optional ForeignEnum                          optional_foreign_enum    = 22;-  optional protobuf_unittest_import.ImportEnum    optional_import_enum     = 23;--  optional string optional_string_piece = 24 [ctype=STRING_PIECE];-  optional string optional_cord = 25 [ctype=CORD];--  // Repeated-  repeated    int32 repeated_int32    = 31;-  repeated    int64 repeated_int64    = 32;-  repeated   uint32 repeated_uint32   = 33;-  repeated   uint64 repeated_uint64   = 34;-  repeated   sint32 repeated_sint32   = 35;-  repeated   sint64 repeated_sint64   = 36;-  repeated  fixed32 repeated_fixed32  = 37;-  repeated  fixed64 repeated_fixed64  = 38;-  repeated sfixed32 repeated_sfixed32 = 39;-  repeated sfixed64 repeated_sfixed64 = 40;-  repeated    float repeated_float    = 41;-  repeated   double repeated_double   = 42;-  repeated     bool repeated_bool     = 43;-  repeated   string repeated_string   = 44;-  repeated    bytes repeated_bytes    = 45;--  repeated group RepeatedGroup = 46 {-    optional int32 a = 47;-  }--  repeated NestedMessage                        repeated_nested_message  = 48;-  repeated ForeignMessage                       repeated_foreign_message = 49;-  repeated protobuf_unittest_import.ImportMessage repeated_import_message  = 50;--  repeated NestedEnum                           repeated_nested_enum     = 51;-  repeated ForeignEnum                          repeated_foreign_enum    = 52;-  repeated protobuf_unittest_import.ImportEnum    repeated_import_enum     = 53;--  repeated string repeated_string_piece = 54 [ctype=STRING_PIECE];-  repeated string repeated_cord = 55 [ctype=CORD];--  // Singular with defaults-  optional    int32 default_int32    = 61 [default =  41    ];-  optional    int64 default_int64    = 62 [default =  42    ];-  optional   uint32 default_uint32   = 63 [default =  43    ];-  optional   uint64 default_uint64   = 64 [default =  44    ];-  optional   sint32 default_sint32   = 65 [default = -45    ];-  optional   sint64 default_sint64   = 66 [default =  46    ];-  optional  fixed32 default_fixed32  = 67 [default =  47    ];-  optional  fixed64 default_fixed64  = 68 [default =  48    ];-  optional sfixed32 default_sfixed32 = 69 [default =  49    ];-  optional sfixed64 default_sfixed64 = 70 [default = -50    ];-  optional    float default_float    = 71 [default =  51.5  ];-  optional   double default_double   = 72 [default =  52e3  ];-  optional     bool default_bool     = 73 [default = true   ];-  optional   string default_string   = 74 [default = "hello"];-  optional    bytes default_bytes    = 75 [default = "world"];--  optional NestedEnum  default_nested_enum  = 81 [default = BAR        ];-  optional ForeignEnum default_foreign_enum = 82 [default = FOREIGN_BAR];-  optional protobuf_unittest_import.ImportEnum-      default_import_enum = 83 [default = IMPORT_BAR];--  optional string default_string_piece = 84 [ctype=STRING_PIECE,default="abc"];-  optional string default_cord = 85 [ctype=CORD,default="123"];-}--// Define these after TestAllTypes to make sure the compiler can handle-// that.-message ForeignMessage {-  optional int32 c = 1;-}--enum ForeignEnum {-  FOREIGN_FOO = 4;-  FOREIGN_BAR = 5;-  FOREIGN_BAZ = 6;-}--message TestAllExtensions {-  extensions 1 to max;-}--extend TestAllExtensions {-  // Singular-  optional    int32 optional_int32_extension    =  1;-  optional    int64 optional_int64_extension    =  2;-  optional   uint32 optional_uint32_extension   =  3;-  optional   uint64 optional_uint64_extension   =  4;-  optional   sint32 optional_sint32_extension   =  5;-  optional   sint64 optional_sint64_extension   =  6;-  optional  fixed32 optional_fixed32_extension  =  7;-  optional  fixed64 optional_fixed64_extension  =  8;-  optional sfixed32 optional_sfixed32_extension =  9;-  optional sfixed64 optional_sfixed64_extension = 10;-  optional    float optional_float_extension    = 11;-  optional   double optional_double_extension   = 12;-  optional     bool optional_bool_extension     = 13;-  optional   string optional_string_extension   = 14;-  optional    bytes optional_bytes_extension    = 15;--  optional group OptionalGroup_extension = 16 {-    optional int32 a = 17;-  }--  optional TestAllTypes.NestedMessage optional_nested_message_extension = 18;-  optional ForeignMessage optional_foreign_message_extension = 19;-  optional protobuf_unittest_import.ImportMessage-    optional_import_message_extension = 20;--  optional TestAllTypes.NestedEnum optional_nested_enum_extension = 21;-  optional ForeignEnum optional_foreign_enum_extension = 22;-  optional protobuf_unittest_import.ImportEnum-    optional_import_enum_extension = 23;--  optional string optional_string_piece_extension = 24 [ctype=STRING_PIECE];-  optional string optional_cord_extension = 25 [ctype=CORD];--  // Repeated-  repeated    int32 repeated_int32_extension    = 31;-  repeated    int64 repeated_int64_extension    = 32;-  repeated   uint32 repeated_uint32_extension   = 33;-  repeated   uint64 repeated_uint64_extension   = 34;-  repeated   sint32 repeated_sint32_extension   = 35;-  repeated   sint64 repeated_sint64_extension   = 36;-  repeated  fixed32 repeated_fixed32_extension  = 37;-  repeated  fixed64 repeated_fixed64_extension  = 38;-  repeated sfixed32 repeated_sfixed32_extension = 39;-  repeated sfixed64 repeated_sfixed64_extension = 40;-  repeated    float repeated_float_extension    = 41;-  repeated   double repeated_double_extension   = 42;-  repeated     bool repeated_bool_extension     = 43;-  repeated   string repeated_string_extension   = 44;-  repeated    bytes repeated_bytes_extension    = 45;--  repeated group RepeatedGroup_extension = 46 {-    optional int32 a = 47;-  }--  repeated TestAllTypes.NestedMessage repeated_nested_message_extension = 48;-  repeated ForeignMessage repeated_foreign_message_extension = 49;-  repeated protobuf_unittest_import.ImportMessage-    repeated_import_message_extension = 50;--  repeated TestAllTypes.NestedEnum repeated_nested_enum_extension = 51;-  repeated ForeignEnum repeated_foreign_enum_extension = 52;-  repeated protobuf_unittest_import.ImportEnum-    repeated_import_enum_extension = 53;--  repeated string repeated_string_piece_extension = 54 [ctype=STRING_PIECE];-  repeated string repeated_cord_extension = 55 [ctype=CORD];--  // Singular with defaults-  optional    int32 default_int32_extension    = 61 [default =  41    ];-  optional    int64 default_int64_extension    = 62 [default =  42    ];-  optional   uint32 default_uint32_extension   = 63 [default =  43    ];-  optional   uint64 default_uint64_extension   = 64 [default =  44    ];-  optional   sint32 default_sint32_extension   = 65 [default = -45    ];-  optional   sint64 default_sint64_extension   = 66 [default =  46    ];-  optional  fixed32 default_fixed32_extension  = 67 [default =  47    ];-  optional  fixed64 default_fixed64_extension  = 68 [default =  48    ];-  optional sfixed32 default_sfixed32_extension = 69 [default =  49    ];-  optional sfixed64 default_sfixed64_extension = 70 [default = -50    ];-  optional    float default_float_extension    = 71 [default =  51.5  ];-  optional   double default_double_extension   = 72 [default =  52e3  ];-  optional     bool default_bool_extension     = 73 [default = true   ];-  optional   string default_string_extension   = 74 [default = "hello"];-  optional    bytes default_bytes_extension    = 75 [default = "world"];--  optional TestAllTypes.NestedEnum-    default_nested_enum_extension = 81 [default = BAR];-  optional ForeignEnum-    default_foreign_enum_extension = 82 [default = FOREIGN_BAR];-  optional protobuf_unittest_import.ImportEnum-    default_import_enum_extension = 83 [default = IMPORT_BAR];--  optional string default_string_piece_extension = 84 [ctype=STRING_PIECE,-                                                       default="abc"];-  optional string default_cord_extension = 85 [ctype=CORD, default="123"];-}--// We have separate messages for testing required fields because it's-// annoying to have to fill in required fields in TestProto in order to-// do anything with it.  Note that we don't need to test every type of-// required filed because the code output is basically identical to-// optional fields for all types.-message TestRequired {-  required int32 a = 1;-  optional int32 dummy2 = 2;-  required int32 b = 3;--  extend TestAllExtensions {-    optional TestRequired single = 1000;-    repeated TestRequired multi  = 1001;-  }--  // Pad the field count to 32 so that we can test that IsInitialized()-  // properly checks multiple elements of has_bits_.-  optional int32 dummy4  =  4;-  optional int32 dummy5  =  5;-  optional int32 dummy6  =  6;-  optional int32 dummy7  =  7;-  optional int32 dummy8  =  8;-  optional int32 dummy9  =  9;-  optional int32 dummy10 = 10;-  optional int32 dummy11 = 11;-  optional int32 dummy12 = 12;-  optional int32 dummy13 = 13;-  optional int32 dummy14 = 14;-  optional int32 dummy15 = 15;-  optional int32 dummy16 = 16;-  optional int32 dummy17 = 17;-  optional int32 dummy18 = 18;-  optional int32 dummy19 = 19;-  optional int32 dummy20 = 20;-  optional int32 dummy21 = 21;-  optional int32 dummy22 = 22;-  optional int32 dummy23 = 23;-  optional int32 dummy24 = 24;-  optional int32 dummy25 = 25;-  optional int32 dummy26 = 26;-  optional int32 dummy27 = 27;-  optional int32 dummy28 = 28;-  optional int32 dummy29 = 29;-  optional int32 dummy30 = 30;-  optional int32 dummy31 = 31;-  optional int32 dummy32 = 32;--  required int32 c = 33;-}--message TestRequiredForeign {-  optional TestRequired optional_message = 1;-  repeated TestRequired repeated_message = 2;-  optional int32 dummy = 3;-}--// Test that we can use NestedMessage from outside TestAllTypes.-message TestForeignNested {-  optional TestAllTypes.NestedMessage foreign_nested = 1;-}--// TestEmptyMessage is used to test unknown field support.-message TestEmptyMessage {-}--// Like above, but declare all field numbers as potential extensions.  No-// actual extensions should ever be defined for this type.-message TestEmptyMessageWithExtensions {-  extensions 1 to max;-}--// Test that really large tag numbers don't break anything.-message TestReallyLargeTagNumber {-  // The largest possible tag number is 2^28 - 1, since the wire format uses-  // three bits to communicate wire type.-  optional int32 a = 1;-  optional int32 bb = 268435455;-}--message TestRecursiveMessage {-  optional TestRecursiveMessage a = 1;-  optional int32 i = 2;-}--// Test that mutual recursion works.-message TestMutualRecursionA {-  optional TestMutualRecursionB bb = 1;-}--message TestMutualRecursionB {-  optional TestMutualRecursionA a = 1;-  optional int32 optional_int32 = 2;-}--// Test that groups have disjoint field numbers from their siblings and-// parents.  This is NOT possible in proto1; only proto2.  When outputting-// proto1, the dup fields should be dropped.-message TestDupFieldNumber {-  optional int32 a = 1;-  optional group Foo = 2 { optional int32 a = 1; }-  optional group Bar = 3 { optional int32 a = 1; }-}---// Needed for a Python test.-message TestNestedMessageHasBits {-  message NestedMessage {-    repeated int32 nestedmessage_repeated_int32 = 1;-    repeated ForeignMessage nestedmessage_repeated_foreignmessage = 2;-  }-  optional NestedMessage optional_nested_message = 1;-}---// Test an enum that has multiple values with the same number.-enum TestEnumWithDupValue {-  FOO1 = 1;-  BAR1 = 2;-  BAZ = 3;-  FOO2 = 1;-  BAR2 = 2;-}--// Test an enum with large, unordered values.-enum TestSparseEnum {-  SPARSE_A = 123;-  SPARSE_B = 62374;-  SPARSE_C = 12589234;-  SPARSE_D = 15; // XXX was -15-  SPARSE_E = 53452; // XXX was -53452-  SPARSE_F = 0;-  SPARSE_G = 2;-}--// Test message with CamelCase field names.  This violates Protocol Buffer-// standard style.-message TestCamelCaseFieldNames {-  optional int32 PrimitiveField = 1;-  optional string StringField = 2;-  optional ForeignEnum EnumField = 3;-  optional ForeignMessage MessageField = 4;-  optional string StringPieceField = 5 [ctype=STRING_PIECE];-  optional string CordField = 6 [ctype=CORD];--  repeated int32 RepeatedPrimitiveField = 7;-  repeated string RepeatedStringField = 8;-  repeated ForeignEnum RepeatedEnumField = 9;-  repeated ForeignMessage RepeatedMessageField = 10;-  repeated string RepeatedStringPieceField = 11 [ctype=STRING_PIECE];-  repeated string RepeatedCordField = 12 [ctype=CORD];-}---// We list fields out of order, to ensure that we're using field number and not-// field index to determine serialization order.-message TestFieldOrderings {-  optional string my_string = 11;-  extensions 2 to 10;-  optional int64 my_int = 1;-  extensions 12 to 100;-  optional float my_float = 101;-}---extend TestFieldOrderings {-  optional string my_extension_string = 50;-  optional int32 my_extension_int = 5;-}---message TestExtremeDefaultValues {-  optional bytes escaped_bytes = 1 [default = "\0\001\a\b\f\n\r\t\v\\\'\"\xfe"];-  optional uint32 large_uint32 = 2 [default = 0xFFFFFFFF];-  optional uint64 large_uint64 = 3 [default = 0xFFFFFFFFFFFFFFFF];-  optional  int32 small_int32  = 4 [default = -0x7FFFFFFF];-  optional  int64 small_int64  = 5 [default = -0x7FFFFFFFFFFFFFFF];--  // The default value here is UTF-8 for "\u1234".  (We could also just type-  // the UTF-8 text directly into this text file rather than escape it, but-  // lots of people use editors that would be confused by this.)-  optional string utf8_string = 6 [default = "\341\210\264"];-}--// Test that RPC services work.-message FooRequest  {}-message FooResponse {}--service TestService {-  rpc Foo(FooRequest) returns (FooResponse);-  rpc Bar(BarRequest) returns (BarResponse);-}---message BarRequest  {}-message BarResponse {}
− tests/google-proto-files/src/google/protobuf/unittest_embed_optimize_for.prot
@@ -1,36 +0,0 @@-// Protocol Buffers - Google's data interchange format-// Copyright 2008 Google Inc.-// http://code.google.com/p/protobuf/-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-//      http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--// Author: kenton@google.com (Kenton Varda)-//  Based on original Protocol Buffers design by-//  Sanjay Ghemawat, Jeff Dean, and others.-//-// A proto file which imports a proto file that uses optimize_for = CODE_SIZE.--import "google/protobuf/unittest_optimize_for.proto";--package protobuf_unittest;--// We optimize for speed here, but we are importing a proto that is optimized-// for code size.-option optimize_for = SPEED;--message TestEmbedOptimizedForSize {-  // Test that embedding a message which has optimize_for = CODE_SIZE into-  // one optimized for speed works.-  optional TestOptimizedForSize optional_message = 1;-  repeated TestOptimizedForSize repeated_message = 2;-}
− tests/google-proto-files/src/google/protobuf/unittest_import.proto
@@ -1,47 +0,0 @@-// Protocol Buffers - Google's data interchange format-// Copyright 2008 Google Inc.-// http://code.google.com/p/protobuf/-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-//      http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--// Author: kenton@google.com (Kenton Varda)-//  Based on original Protocol Buffers design by-//  Sanjay Ghemawat, Jeff Dean, and others.-//-// A proto file which is imported by unittest.proto to test importing.---// We don't put this in a package within proto2 because we need to make sure-// that the generated code doesn't depend on being in the proto2 namespace.-// In test_util.h we do-// "using namespace unittest_import = protobuf_unittest_import".-package protobuf_unittest_import;--option optimize_for = SPEED;--// Excercise the java_package option.-option java_package = "com.google.protobuf.test";--// Do not set a java_outer_classname here to verify that Proto2 works without-// one.--message ImportMessage {-  optional int32 d = 1;-}--enum ImportEnum {-  IMPORT_FOO = 7;-  IMPORT_BAR = 8;-  IMPORT_BAZ = 9;-}-
− tests/google-proto-files/src/google/protobuf/unittest_mset.proto
@@ -1,58 +0,0 @@-// Protocol Buffers - Google's data interchange format-// Copyright 2008 Google Inc.-// http://code.google.com/p/protobuf/-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-//      http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--// Author: kenton@google.com (Kenton Varda)-//  Based on original Protocol Buffers design by-//  Sanjay Ghemawat, Jeff Dean, and others.-//-// This file contains messages for testing message_set_wire_format.--package protobuf_unittest;--option optimize_for = SPEED;--// A message with message_set_wire_format.-message TestMessageSet {-  option message_set_wire_format = true;-  extensions 4 to max;-}--message TestMessageSetContainer {-  optional TestMessageSet message_set = 1;-}--message TestMessageSetExtension1 {-  extend TestMessageSet {-    optional TestMessageSetExtension1 message_set_extension = 1545008;-  }-  optional int32 i = 15;-}--message TestMessageSetExtension2 {-  extend TestMessageSet {-    optional TestMessageSetExtension2 message_set_extension = 1547769;-  }-  optional string str = 25;-}--// MessageSet wire format is equivalent to this.-message RawMessageSet {-  repeated group Item = 1 {-    required int32 type_id = 2;-    required bytes message = 3;-  }-}-
− tests/google-proto-files/src/google/protobuf/unittest_optimize_for.proto
@@ -1,38 +0,0 @@-// Protocol Buffers - Google's data interchange format-// Copyright 2008 Google Inc.-// http://code.google.com/p/protobuf/-//-// Licensed under the Apache License, Version 2.0 (the "License");-// you may not use this file except in compliance with the License.-// You may obtain a copy of the License at-//-//      http://www.apache.org/licenses/LICENSE-2.0-//-// Unless required by applicable law or agreed to in writing, software-// distributed under the License is distributed on an "AS IS" BASIS,-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.-// See the License for the specific language governing permissions and-// limitations under the License.--// Author: kenton@google.com (Kenton Varda)-//  Based on original Protocol Buffers design by-//  Sanjay Ghemawat, Jeff Dean, and others.-//-// A proto file which uses optimize_for = CODE_SIZE.--import "google/protobuf/unittest.proto";--package protobuf_unittest;--option optimize_for = CODE_SIZE;--message TestOptimizedForSize {-  optional int32 i = 1;-  optional ForeignMessage msg = 19;--  extensions 1000 to max;--  extend TestOptimizedForSize {-    optional int32 test_extension = 1234;-  }-}
− tests/patchBoot
@@ -1,92 +0,0 @@-diff -Nru UnittestProto/TestAllExtensions.hs-boot Unew/TestAllExtensions.hs-boot---- UnittestProto/TestAllExtensions.hs-boot	1970-01-01 01:00:00.000000000 +0100-+++ Unew/TestAllExtensions.hs-boot	2008-09-18 19:13:19.000000000 +0100-@@ -0,0 +1,19 @@-+module UnittestProto.TestAllExtensions (TestAllExtensions) where-+-+import qualified Prelude as P'(Show,Eq,Ord,Maybe,Double,Float)-+import qualified Text.ProtocolBuffers.Header as P'(Typeable,Mergeable,Default,Wire,MessageAPI,GPB,ReflectDescriptor-+                                                  ,Seq,Utf8,ByteString,Int32,Int64,Word32,Word64,ExtendMessage)-+-+data TestAllExtensions-+-+instance P'.Show TestAllExtensions-+instance P'.Eq TestAllExtensions-+instance P'.Ord TestAllExtensions-+instance P'.Typeable TestAllExtensions-+instance P'.Mergeable TestAllExtensions-+instance P'.Default TestAllExtensions-+instance P'.Wire TestAllExtensions-+instance P'.MessageAPI msg' (msg' -> TestAllExtensions) TestAllExtensions-+instance P'.GPB TestAllExtensions-+instance P'.ExtendMessage TestAllExtensions-+instance P'.ReflectDescriptor TestAllExtensions-diff -Nru UnittestProto/TestFieldOrderings.hs-boot Unew/TestFieldOrderings.hs-boot---- UnittestProto/TestFieldOrderings.hs-boot	1970-01-01 01:00:00.000000000 +0100-+++ Unew/TestFieldOrderings.hs-boot	2008-09-18 19:12:51.000000000 +0100-@@ -0,0 +1,19 @@-+module UnittestProto.TestFieldOrderings (TestFieldOrderings) where-+-+import qualified Prelude as P'(Show,Eq,Ord,Maybe,Double,Float)-+import qualified Text.ProtocolBuffers.Header as P'(Typeable,Mergeable,Default,Wire,MessageAPI,GPB,ReflectDescriptor-+                                                  ,Seq,Utf8,ByteString,Int32,Int64,Word32,Word64,ExtendMessage)-+-+data TestFieldOrderings-+-+instance P'.Show TestFieldOrderings-+instance P'.Eq TestFieldOrderings-+instance P'.Ord TestFieldOrderings-+instance P'.Typeable TestFieldOrderings-+instance P'.Mergeable TestFieldOrderings-+instance P'.Default TestFieldOrderings-+instance P'.Wire TestFieldOrderings-+instance P'.MessageAPI msg' (msg' -> TestFieldOrderings) TestFieldOrderings-+instance P'.GPB TestFieldOrderings-+instance P'.ExtendMessage TestFieldOrderings-+instance P'.ReflectDescriptor TestFieldOrderings-diff -Nru UnittestProto/TestMutualRecursionA.hs-boot Unew/TestMutualRecursionA.hs-boot---- UnittestProto/TestMutualRecursionA.hs-boot	1970-01-01 01:00:00.000000000 +0100-+++ Unew/TestMutualRecursionA.hs-boot	2008-09-18 19:12:13.000000000 +0100-@@ -0,0 +1,18 @@-+module UnittestProto.TestMutualRecursionA (TestMutualRecursionA) where-+-+import qualified Prelude as P'(Show,Eq,Ord,Maybe,Double,Float)-+import qualified Text.ProtocolBuffers.Header as P'(Typeable,Mergeable,Default,Wire,MessageAPI,GPB,ReflectDescriptor-+                                                  ,Seq,Utf8,ByteString,Int32,Int64,Word32,Word64,ExtendMessage)-+-+data TestMutualRecursionA-+-+instance P'.Show TestMutualRecursionA-+instance P'.Eq TestMutualRecursionA-+instance P'.Ord TestMutualRecursionA-+instance P'.Typeable TestMutualRecursionA-+instance P'.Mergeable TestMutualRecursionA-+instance P'.Default TestMutualRecursionA-+instance P'.Wire TestMutualRecursionA-+instance P'.MessageAPI msg' (msg' -> TestMutualRecursionA) TestMutualRecursionA-+instance P'.GPB TestMutualRecursionA-+instance P'.ReflectDescriptor TestMutualRecursionA-diff -Nru UnittestProto/TestMutualRecursionB.hs Unew/TestMutualRecursionB.hs---- UnittestProto/TestMutualRecursionB.hs	2008-09-19 06:31:10.000000000 +0100-+++ Unew/TestMutualRecursionB.hs	2008-09-18 19:15:29.000000000 +0100-@@ -2,7 +2,7 @@- import Prelude ((+))- import qualified Prelude as P'- import qualified Text.ProtocolBuffers.Header as P'--import qualified UnittestProto.TestMutualRecursionA as UnittestProto (TestMutualRecursionA)-+import {-# SOURCE #-} qualified UnittestProto.TestMutualRecursionA as UnittestProto (TestMutualRecursionA)-  - data TestMutualRecursionB = TestMutualRecursionB{a :: P'.Maybe UnittestProto.TestMutualRecursionA,-                                                  optional_int32 :: P'.Maybe P'.Int32}-diff -Nru UnittestProto/TestRequired.hs Unew/TestRequired.hs---- UnittestProto/TestRequired.hs	2008-09-19 06:31:09.000000000 +0100-+++ Unew/TestRequired.hs	2008-09-18 19:14:48.000000000 +0100-@@ -2,7 +2,7 @@- import Prelude ((+))- import qualified Prelude as P'- import qualified Text.ProtocolBuffers.Header as P'--import qualified UnittestProto.TestAllExtensions as UnittestProto (TestAllExtensions)-+import {-# SOURCE #-} qualified UnittestProto.TestAllExtensions as UnittestProto (TestAllExtensions)-  - data TestRequired = TestRequired{a :: P'.Int32, dummy2 :: P'.Maybe P'.Int32, b :: P'.Int32, dummy4 :: P'.Maybe P'.Int32,-                                  dummy5 :: P'.Maybe P'.Int32, dummy6 :: P'.Maybe P'.Int32, dummy7 :: P'.Maybe P'.Int32,