packages feed

protobuf-simple 0.1.0.3 → 0.1.0.4

raw patch · 3 files changed

+12/−6 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

protobuf-simple.cabal view
@@ -3,7 +3,7 @@  name:                protobuf-simple synopsis:            Simple Protocol Buffers library (proto2)-version:             0.1.0.3+version:             0.1.0.4 homepage:            https://github.com/sru-systems/protobuf-simple license:             MIT license-file:        LICENSE
src/Data/ProtoBufInt.hs view
@@ -41,7 +41,7 @@ import Data.Set              as Export (fromList) import Data.Text.Lazy        as Export (Text, pack) import Data.Word             as Export (Word32, Word64)-import Prelude               as Export (Double, Eq, Float, Ord, Show)+import Prelude               as Export (Double, Eq, Float, Ord, Show, return)   -- | Append a value to a Seq.
src/Parser/MessageGenerator.hs view
@@ -69,7 +69,9 @@  getImports :: FileDesc -> MessageDesc -> State GenState Builder getImports f md = return $-    getUnqualifiedImport "Control.Applicative" "(<$>)" <>+    (if MessageDesc.getFields md == []+       then fromString ""+       else getUnqualifiedImport "Control.Applicative" "(<$>)") <>     getUnqualifiedImport "Prelude" "" <>     getQualifiedAsImport "Data.ProtoBufInt" "PB" <>     getExtraImports f md@@ -276,7 +278,9 @@     mergeableLines <- getMergeableLines fields     return $       fromString "instance PB.Mergeable " <> fromString name <> fromString " where" <> nl <>-      tab <> fromString "merge a b = " <> fromString name <> nl <>+      tab <> (if mergeableLines == fromString ""+                then fromString "merge _ _ = "+                else fromString "merge a b = ") <> fromString name <> nl <>       tab <> tab <> fromString "{ " <>       mergeableLines <> nl <>       tab <> tab <> fromString "}" <> nl@@ -368,8 +372,10 @@     return $       fromString "instance PB.WireMessage " <> fromString name <> fromString " where" <> nl <>       flines <> nl <>-      tab <> fromString "messageToFields self = do" <> nl <>-      mlines <> nl+      tab <> if mlines == fromString ""+               then fromString "messageToFields _ = PB.return ()" <> nl+               else fromString "messageToFields self = do" <> nl <>+                    mlines <> nl   where     name = MessageDesc.getName md     fields = MessageDesc.getFields md