J^;      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ ;7 is supposed to allow the execution of the monad to be > halted, awaiting more input. The computation is supposed to A continue normally if this returns True, and is supposed to halt B without calling suspend again if this returns False. All future A calls to suspend will return False automatically and no nothing  else. DThese semantics are too specialized to let this escape this module.  runs the todo" action and then rewinds only the ) BinaryParser state. Any new input from  or changes from  3 are kept. Changes to the user state (MonadState) 0 are kept. The MonadWriter output is retained. CIf an error is thrown then the entire monad state is reset to last  catchError as usual.  runs the todo action. If the action returns  then the & BinaryParser state is rewound (as in ). If the action return  then F the BinaryParser is not rewound, and lookAheadM acts as an identity. CIf an error is thrown then the entire monad state is reset to last  catchError as usual.  runs the todo action. If the action returns  then the & BinaryParser state is rewound (as in ). If the action return  then F the BinaryParser is not rewound, and lookAheadE acts as an identity. CIf an error is thrown then the entire monad state is reset to last  catchError as usual.  is the simple executor 1Get the input currently available to the parser. * replaces the bytestream past the current # of read > bytes. This will also affect pending MonadError handler and @ MonadPlus branches. I think all pending branches have to have A fewer bytesRead than the current one. If this is wrong then an  error will be thrown.  WARNING :  is still untested.  Keep calling  until Nothing is passed to the   C continuation. This ensures all the data has been loaded into the  state of the parser. 3Call suspend and throw and error with the provided msg if  Nothing has been passed to the   continuation. Otherwise  return (). check that there are at least n bytes available in the input. / This will suspend if there is to little data. Pull n8 bytes from the unput, as a lazy ByteString. This will & suspend if there is too little data. ) causes the most recent catchError to be F discarded, i.e. this reduces the stack of error handlers by removing > the top one. These are the same handlers which Alternative(( |)) and O MonadPlus(mplus) use. This is useful to commit to the current branch and let E the garbage collector release the suspended handler and its hold on  the earlier input. Discard the next m bytes Return the number of ' so far. Initially 0, never negative. Return the number of bytes  before the current input  runs out and  might be called. #Return True if the number of bytes  is 0. Any futher , attempts to read an empty parser will call  which might " result in more input to consume.  Compare with  BReturn True if the input is exhausted and will never be added to. 2 Returns False if there is input left to consume.  Compare with  Pull n: bytes from the input, as a strict ByteString. This will D suspend if there is too little data. If the result spans multiple A lazy chunks then the result occupies a freshly allocated strict C bytestring, otherwise it fits in a single chunk and refers to the 1 same immutable memory block as the whole chunk.  !"#$%&'()I use splitAt= without tolerating too few bytes, so write a Maybe version. U This is the only place I invoke L.Chunk as constructor instead of pattern matching. 2 I claim that the first argument cannot be empty. *!  !"#$%&'()*!   * !$'"%(#&)!   !"#$%&'()*+The +6 class is for internal use, and may change. If there  is a mis-match between the :9 and the type of b then you  will get a failure at runtime. 7Users should stick to the message functions defined in   Text.ProtocolBuffers.WireMessage and exported to use user by  Text.ProtocolBuffers$. These are less likely to change. ,-./@The Default class has the default-default values of types. See   Dhttp://code.google.com/apis/protocolbuffers/docs/proto.html#optional  and also note that  types have a 0 that is the  first one in the .proto$ file (there is always at least one @ value). Instances of this for messages hold any default value  defined in the .proto file. 0 is where the   MessageAPI function getVal% looks when an optional field is not  set. 0The 0, is never undefined or an error to evalute. , This makes it much more useful compared to 2. In a 6 default message all Optional field values are set to  & and Repeated field values are empty. 1The 1 class is not a Monoid, 2 is not a  left or right unit like mempty. The default 3 is to ; take the second parameter and discard the first one. The  4 defaults to foldl associativity. 2The 2) value of a basic type or a message with : required fields will be undefined and a runtime error to C evaluate. These are only handy for reading the wire encoding and  users should employ 0 instead. 33- is the right-biased merge of two values. A ? message (or group) is merged recursively. Required field are A always taken from the second message. Optional field values are ? taken from the most defined message or the message message if A both are set. Repeated fields have the sequences concatenated. 3 Note that strings and bytes are NOT concatenated. 44 is  F.foldl mergeAppend mergeEmpty  and this 9 default definition is not overrring in any of the code. 550 is the Int64 size type associate with the lazy  bytestrings used in the  and   monads. 676 is the Int32 assoicated with a ; EnumValueDescriptorProto and is in the range 0 to 2^31-1. 789:9$ is the integer associated with the  FieldDescriptorProto'-s Type. The allowed range is currently 1 to 4 18, as shown below (excerpt from descritor.proto) ! // 0 is reserved for errors. . // Order is weird for historical reasons.  TYPE_DOUBLE = 1;  TYPE_FLOAT = 2; H TYPE_INT64 = 3; // Not ZigZag encoded. Negative numbers N // take 10 bytes. Use TYPE_SINT64 if negative 5 // values are likely.  TYPE_UINT64 = 4; H TYPE_INT32 = 5; // Not ZigZag encoded. Negative numbers N // take 10 bytes. Use TYPE_SINT32 if negative 5 // 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; 8 TYPE_SINT32 = 17; // Uses ZigZag encoding. 8 TYPE_SINT64 = 18; // Uses ZigZag encoding. :;<=<7 is the 3 bit wire encoding value, and is currently in 6 the range 0 to 5, leaving 6 and 7 currently invalid.  0 Varint< : int32, int64, uint32, uint64, sint32, sint64, bool, enum  1 64-bit : fixed64, sfixed64, double  2 Length-delimited$ : string, bytes, embedded messages  3  Start group : groups (deprecated)  4  End group : groups (deprecated)  5 32-bit : fixed32, sfixed32, float =>?@?4 is the field number which can be in the range 1 to C 2^29-1 but the value from 19000 to 19999 are forbidden (so sayeth  Google). @ABCB6 is the 32 bit value with the upper 29 bits being the  @? and the lower 3 bits being the =< CDEFE is used to mark  values that (should) contain = valud utf8 encoded strings. This type is used to represent   TYPE_STRING values. FG# +,-./0123456789:;<=>?@ABCDEFG# EFGBCD?@A<=>9:;67851234/0+,-.+,-.,-./0012342345678789:;:;<=>=>?@A@ABCDCDEFGFG;HIThis is obtained via  on the stored  output of the ml in @ the module file. It is used in getting messages from the wire. Must not inspect argument JMust not inspect argument KLMMust not inspect argument NMust not inspect argument OPQRSTUU4 stores the parsed default from the proto file in a + form that will make a nice literal in the  Language.Haskell.Exts.Syntax code generation by hprotoc. ANote that Utf8 labeled byte sequences have been stripped to just  1 here as this is sufficient for code generation. VWXYZ[\]^_`/Bytes required in the Varint formatted wireTag abc<fromEnum of Text.DescriptorProtos.FieldDescriptorProto.Type d"Set for Messages,Groups,and Enums ecrappy, but not escaped, thing fnice parsed thing ghih0 is used in getting messages from the wire. It  supplies the 0 of precomposed wire tags that must be found in  the message as well as a & of all allowed tags (including known / extension fields and all required wire tags). BExtension fields not in the allowedTags set are still loaded, but  only as , blobs that will have to interpreted later. ijklmnopqrstuvwxyz{|}~AThis is fully qualified name data type for code generation. The   was possibly specified on the hprotoc command  line. The ' is a combination of the module prefix  from the '.proto'+ file and any nested levels of definition. BThe name components are likely to have been mangled to ensure the  & started with an uppercase letter, in  ['A'..'Z'] . <Haskell specific prefix to module hierarchy (e.g. Text.Foo) 0Proto specified namespace (like Com.Google.Bar) 0unqualfied name of this thing (with no periods) ;HIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~;~uvwxyz{|}lmnopqrst[\]^_`abcdefgUZYXWVPQRSTOHIJKLMNhijk;HIJIJKLMNLMNOPQRSTQRSTUZYXWVVWXYZ[ \]^_`abcdef\]^_`abcdefghijkijklmnopqrstmnopqrstuvwxyz{|}vwxyz{|}~1%This computes the size of the message's fields with tags on the B wire with no initial tag or length (in bytes). This is also the D length of the message as placed between group start and stop tags. 3This computes the size of the message fields as in  D and add the length of the encoded size to the total. Thus this is D the the length of the message including the encoded length header,  but without any leading tag. This computes the size of the  and then / adds the length an initial tag with the given @?. This is  applied to . It result in a   with a length of  bytes. This is  applied to . It results  in a  with a length of  bytes. This writes just the message'&s fields with tags to the wire. This  4 monad can be composed and eventually executed with . This is actually  wirePut 10 msg  -This writes the encoded length of the message's fields and then  the message'&s fields with tags to the wire. This  monad can + be composed and eventually executed with . This is actually  wirePut 11 msg  /This writes an encoded wire tag with the given @? and then # the encoded length of the message's fields and then the message's & fields with tags to the wire. This  monad can be composed  and eventually executed with . This consumes the " to decode a message. It assumes  the 2 is merely a sequence of the tagged fields of the A message, and consumes until a group stop tag is detected or the  entire input is consumed. Any  past the end of the  stop tag is returned as well. This is  applied to . This  applied to . AThis first reads the encoded length of the message and will then D succeed when it has consumed precisely this many additional bytes.  The $ after this point will be returned. ?This reads the tagged message fields until the stop tag or the  end of input is reached. This is actually  wireGet 10 msg  <This reads the encoded message length and then the message. This is actually  wireGet 11 msg  'This reads a wire tag (must be of type '2' ) to get the @?. B Then the encoded message length is read, followed by the message  itself. Both the @? and the message are returned. 4This allows for incremental reading and processing. This is  with the  results converted to   calls and the trailing  discarded. This use of 7 runtime errors is discouraged, but may be convenient. Used in generated code. Used in generated code. Used in generated code. Used in generated code. Used in generated code. Used in generated code. Used in generated code. Used in generated code. Used by generated code Used by generated code [ getBareMessage assumes the wireTag for the message, if it existed, has already been read. ] getBareMessage assumes that it does needs to read the Varint encoded length of the message. S getBareMessage will consume the entire ByteString it is operating on, or until it  finds any STOP_GROUP tag 8 +,-.8 +,-./2<Access data in a message. The first argument is always the ; message. The second argument can be one of 4 categories. ? The field name of a required field acts a simple retrieval of  the data from the message. ? The field name of an optional field will retreive the data if 9 it is set or lookup the default value if it is not set. 9 The field name of a repeated field always retrieves the  (possibly empty)   of values. ? A Key for an optional or repeated value will act as the field A name does above, but if there is a type mismatch or parse error > it will use the defaultValue for optional types and an empty  sequence for repeated types. .Check whether data is present in the message.  Required fields always return . 4 Optional fields return whether a value is present.  Repeated field return # if there are no values, otherwise  they return . = Keys return as optional or repeated, but checks only if the  field #8 is present. This assumes that there are no collisions A where more that one key refers to the same field number of this  message type. The  and  GADTs use  as a shorthand for many  classes. The 0 class has three functions for user of the API:  , , and . The  is used in  generated code. 'There are two instances of this class,  for optional message  fields and  1 for repeated message fields. This class allows ? for uniform treatment of these two kinds of extension fields. 9Change or clear the value of a key in a message. Passing  " with an optional key or an empty   with a repeated C key clears the value. This function thus maintains the invariant # that having a field number in the  map means that the  field is set and not empty. BThis should be only way to set the contents of a extension field. 3Access the key in the message. Optional have type  (Key Maybe  msg v) and return type  (Maybe v) while repeated fields have  type (Key Seq msg v) and return type (Seq v). >There are a few sources of errors with the lookup of the key: 6 It may find unparsed bytes from loading the message.  , will attempt to parse the bytes as the key's value type, and * may fail. The parsing is done with the  parseWireExt method ' (which is not exported to user API). > The wrong optional-key versus repeated-key type is a failure ; The wrong type of the value might be found in the map and  * cause a failure @The failures above should only happen if two different keys are " used with the same field number. ) abstracts the operations of storing and  retrieving the $ from the message, and provides the 4 reflection needed to know the valid field numbers. This only used internally. ExtField is a newtype'*d map from the numeric FieldId key to the = ExtFieldValue. This allows for the needed class instances. 6The WireType is used to ensure the Seq is homogenous. 5 The ByteString is the unparsed input after the tag. ! The WireSize includes all tags. The  is another specialization of Dynamic and is used  in  for repeated fields. The  is my specialization of Dynamic. It hides the type  with an existential but the  brings the class instances  into scope. This is used in  for optional fields.  is an instance witness for the  classes. This  exists mainly to be a part of  or . The  data type is used with the  class to put, get, - and clear external fields of messages. The  can also be used  with the  MessagesAPI. to get a possibly default value and to check * whether a key has been set in a message. The 7 type (opaque to the user) has a phantom type of Maybe ? or Seq that corresponds to Optional or Repeated fields. And a C second phantom type that matches the message type it must be used A with. The third type parameter corresonds to the Haskell value  type. The 9 is a GADT that puts all the needed class instances into # scope. The actual content is the @? ( numeric key), the  :9 (for sanity checks), and Maybe v (a non-standard  default value). DWhen code is generated all of the known keys are taken into account E in the deserialization from the wire. Unknown extension fields are ? read as a collection of raw byte sequences. If a key is then / presented it will be used to parse the bytes. BThere is no guarantee for what happens if two Keys disagree about B the type of a field; in particular there may be undefined values / and runtime errors. The data constructor for  has to be C exported to the generated code, but is not exposed to the user by  Text.ProtocolBuffers. <This allows reflection, in this case it gives the numerical  @?8 of the key, from 1 to 2^29-1 (excluding 19,000 through  19,999). 2This allows reflection, in this case it gives the :9 $ enumeration value (1 to 18) of the  /Text.DescriptorProtos.FieldDescriptorProto.Type of the field. /This will return the default value for a given  , which is  set in the '.proto' file, or if unset it is the 0 of  that type. used by  and  for the  instance  Converts the the   into an   type and enforces  consumption of entire  . Used by   and  ) to process raw wire input that has been  stored in an .  used by  and  for the   instance #This is used by the generated code >This is used by the generated code. The data is serialized in # order of increasing field number. HThis is used by the generated code to get messages that have extensions HThis is used by the generated code to get messages that have extensions    is used by   to check whether the field 0 number is in one of the ranges declared in the '.proto' file.  *get a value from the wire into the message's ExtField. This is  used by  and  above. AThis reads in the raw bytestring corresponding to an field known  only through the wiretag's @? and =<. 'After a group start tag with the given @? this will skip > ahead in the stream past the end tag of that group. Used by  0 to help compule the length of an unknown field  when loading an extension. j ! +,-./0123456789:;<=>?@ABCDEFGHIJKLMNPQRSTls~ j +/01234569<?BEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefglmnopqrstuvwxyz{|}~"     !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJJKLLMNNOPPQRRSTTUVWXYZ[\]^^_`abcdefghhijklmnopqrsttuvwwxyz{|}~                     ! " # $ % & ' ( ) * + ,- ./protocol-buffers-0.2.9Text.ProtocolBuffers.Basic Text.ProtocolBuffers.WireMessageText.ProtocolBuffers.HeaderText.ProtocolBuffers.Get Text.ProtocolBuffers.ReflectionsText.ProtocolBuffers.ExtensionsText.ProtocolBuffers.DefaultText.ProtocolBuffers.MergeableText.ProtocolBuffersbaseGHC.IntInt32Int64GHC.WordWord32Word64bytestring-0.9.1.7Data.ByteString.Lazy.Internal ByteStringbinary-0.5.0.2Data.Binary.PutputLazyByteStringrunPutPutData.ByteString.Lazy.Char8packcontainers-0.3.0.0 Data.SequenceSeqGetResultPartialFinishedFailed lookAhead lookAheadM lookAheadErunGet getAvailable putAvailablesuspendUntilComplete ensureBytesgetLazyByteStringskip bytesRead remainingisEmpty isReallyEmptyspanOf getByteString getWordhostgetWord8 getWord16be getWord16le getWord16host getWord32be getWord32le getWord32host getWord64be getWord64le getWord64host getStorableWirewireSizewirePutwireGetDefault defaultValue Mergeable mergeEmpty mergeAppend mergeConcatWireSizeEnumCode getEnumCode FieldType getFieldTypeWireType getWireTypeFieldId getFieldIdWireTag getWireTagUtf8utf8ReflectDescriptorgetMessageInforeflectDescriptorInfo ReflectEnum reflectEnumreflectEnumInfo parentOfEnum EnumInfoAppEnumInfoenumName enumFilePath enumValues HsDefault HsDef'Enum HsDef'IntegerHsDef'RationalHsDef'ByteString HsDef'Bool FieldInfo fieldName fieldNumberwireTag wireTagLength isRequired canRepeattypeCodetypeName hsRawDefault hsDefaultKeyInfoGetMessageInfo requiredTags allowedTagsDescriptorInfodescName descFilePathisGroupfieldskeys extRanges knownKeys ProtoInfoprotoMod protoFilePath protoSource extensionKeysmessagesenums knownKeyMap ProtoName haskellPrefix parentModulebaseName messageSizemessageWithLengthSizemessageAsFieldSize messagePutmessageWithLengthPut messagePutMmessageWithLengthPutMmessageAsFieldPutM messageGetmessageWithLengthGet messageGetMmessageWithLengthGetMmessageAsFieldGetM getFromBS runGetOnLazyprependMessageSize wirePutReq wirePutOpt wirePutRep wireSizeReq wireSizeOpt wireSizeRepputSize toWireTag mkWireTag splitWireTag getMessagegetMessageWithunknowngetBareMessagegetBareMessageWith unknownFieldcastWord32ToFloatcastFloatToWord32castWord64ToDoublecastDoubleToWord64 wireSizeErr wirePutErr wireGetErr size'Varint zzEncode32 zzEncode64 zzDecode32 zzDecode64 getVarInt putVarUInt toWireType MessageAPIgetValisSetGPBExtKeyputExtgetExtclearExt wireGetKey ExtendMessage getExtField putExtFieldvalidExtRangesExtFieldKey getKeyFieldIdgetKeyFieldTypegetKeyDefaultValuewireSizeExtFieldwirePutExtField getMessageExtgetBareMessageExtappendemptyBS MonadSuspendsuspendunGetSuccess FrameStack HandlerFrame ErrorFrameStopcurrentconsumed setCheckpoint useCheckpointclearCheckpoint Data.MaybeNothingJust Data.EitherLeftRightcollectgetFullputFull suspendMsgdiscardInnerHandler splitAtOrDiegetPtr shiftl_w16 shiftl_w32 shiftl_w64GHC.EnumEnum Text.ReadreadGHC.ShowshowData.SetSetmayMergeGHC.ErrerrordivBy putVarSIntghc-primGHC.BoolTrueFalse GPWitnessMaybeDummyMessageType ExtFieldValue ExtRepeated ExtOptional ExtFromWireGPDynSeqGPDynerrmergeExtFieldValue gpWitnessC gpWitnessDTordGPDyneqGPDyn ordGPDynSeq eqGPDynSeqparseWireExtMaybeapplyGetEitherparseWireExtSeq isValidExt extensionwireGetFromWire skipGroup Data.DataData Data.TypeableTypeablegmapMogmapMpgmapMgmapQigmapQgmapQrgmapQlgmapT dataCast2 dataCast1 dataTypeOftoConstrgunfoldgfoldl Control.MonadaptypeOf