diff --git a/proto-lens-combinators/package.yaml b/proto-lens-combinators/package.yaml index cf891817..66a62cbb 100644 --- a/proto-lens-combinators/package.yaml +++ b/proto-lens-combinators/package.yaml @@ -27,7 +27,7 @@ library: exposed-modules: - Data.ProtoLens.Combinators dependencies: - - data-default-class >= 0.0 && < 0.2 + - proto-lens == 0.4.* - transformers >= 0.4 && < 0.6 tests: diff --git a/proto-lens-combinators/src/Data/ProtoLens/Combinators.hs b/proto-lens-combinators/src/Data/ProtoLens/Combinators.hs index af18cdfb..b49685ea 100644 --- a/proto-lens-combinators/src/Data/ProtoLens/Combinators.hs +++ b/proto-lens-combinators/src/Data/ProtoLens/Combinators.hs @@ -16,7 +16,7 @@ module Data.ProtoLens.Combinators ) where import Control.Monad.Trans.State (State, execState) -import Data.Default.Class (Default(def)) +import Data.ProtoLens (Message, def) import Data.Maybe (isJust) import Lens.Family2 (LensLike, Phantom, Setter, to, (.~)) @@ -33,7 +33,7 @@ clear = (.~ Nothing) -- | Creates a 'Default' and then applies the provided `State` to it. This is -- convenient for creating complicated structures. -make :: Default def => State def a -> def +make :: Message msg => State msg a -> msg make = modifyInState def -- | Allows one to modify a value in the 'State' monad. Note that this is diff --git a/proto-lens-discrimination/package.yaml b/proto-lens-discrimination/package.yaml index 0794e863..08a052bb 100644 --- a/proto-lens-discrimination/package.yaml +++ b/proto-lens-discrimination/package.yaml @@ -21,7 +21,6 @@ custom-setup: dependencies: - base >= 4.9 && < 4.12 - - data-default >= 0.5 && < 0.8 - bytestring == 0.10.* - contravariant >= 1.3 && < 1.5 - containers >= 0.5 && < 0.6 @@ -54,6 +53,9 @@ tests: other-modules: - Proto.Enum - Proto.Enum_Fields + - Proto.Map + - Proto.Map_Fields + # Manually list autogenerated modules, to avoid hpack # requiring `cabal-version: >= 2.0`. verbatim: @@ -61,3 +63,5 @@ tests: autogen-modules: Proto.Enum Proto.Enum_Fields + Proto.Map + Proto.Map_Fields diff --git a/proto-lens-discrimination/src/Data/ProtoLens/Discrimination.hs b/proto-lens-discrimination/src/Data/ProtoLens/Discrimination.hs index 1b6e8a23..04f12c51 100644 --- a/proto-lens-discrimination/src/Data/ProtoLens/Discrimination.hs +++ b/proto-lens-discrimination/src/Data/ProtoLens/Discrimination.hs @@ -15,7 +15,6 @@ module Data.ProtoLens.Discrimination import Data.Bits ((.|.), shift) import qualified Data.ByteString as B import qualified Data.ByteString.Unsafe as B (unsafeIndex) -import Data.Default (Default(def)) import Data.Foldable (foldMap) import Data.Functor.Contravariant ( Contravariant(contramap) @@ -42,6 +41,8 @@ import Data.ProtoLens.Message ( FieldDescriptor(FieldDescriptor) , FieldTypeDescriptor(..) , FieldAccessor(..) + , Message + , def ) -- | Sort values according to a Foldable of field descriptors. @@ -126,7 +127,7 @@ discFieldSet discList disc32 disc64 discBS discInt = -- This should be identical to sorting @Map key value@s using the 'Ord' of -- @key@ and the 'Message' of value. discProtoMapAssocs - :: forall f entry key value. (Contravariant f, Default entry) + :: forall f entry key value. (Contravariant f, Message entry) => (forall a. f a -> f [a]) -> f entry -> Lens' entry key diff --git a/proto-lens-discrimination/tests/disc_test.hs b/proto-lens-discrimination/tests/disc_test.hs index 21552002..d35b4d01 100644 --- a/proto-lens-discrimination/tests/disc_test.hs +++ b/proto-lens-discrimination/tests/disc_test.hs @@ -3,11 +3,10 @@ module Main where import Control.Applicative ((<$>)) -import Data.Default (Default(def)) import Data.Discrimination (Sort, runSort, sorting, sorting1) import Data.Int (Int32) import Data.List (sortBy) -import Lens.Family2 ((&), (^.), (.~)) +import Lens.Family2 (Lens', (&), (^.), (.~)) import Lens.Family2.Stock (_1, _2) import Test.HUnit ((@=?), Assertion) import Test.Framework (testGroup, defaultMain) @@ -24,12 +23,15 @@ import Data.ProtoLens.Message , Message(fieldsByTextFormatName) , ScalarField(..) , MessageOrGroup(..) + , def ) import Data.ProtoLens.Discrimination (discProtoMapAssocs) import Data.ProtoLens.Sort import Proto.Enum import Proto.Enum_Fields +import Proto.Map +import Proto.Map_Fields sortCompare :: Sort a -> a -> a -> Ordering @@ -96,7 +98,9 @@ protoMapSortTest = testGroup "map" in compare x' y' == sortCompare c x' y' ] where - c = discProtoMapAssocs sorting1 sorting _1 _2 + c = discProtoMapAssocs sorting1 sortingMessage + (key :: Lens' MapWrapper'IntMapEntry Int32) + value fieldSortTest :: Test fieldSortTest = testProperty "compares by field" $ diff --git a/proto-lens-discrimination/tests/map.proto b/proto-lens-discrimination/tests/map.proto new file mode 100644 index 00000000..9120b9c5 --- /dev/null +++ b/proto-lens-discrimination/tests/map.proto @@ -0,0 +1,8 @@ +syntax = "proto2"; + +package map; + +message MapWrapper { + map int_map = 1; +} + diff --git a/proto-lens-protoc/src/Data/ProtoLens/Compiler/Generate.hs b/proto-lens-protoc/src/Data/ProtoLens/Compiler/Generate.hs index 78ba82f7..85b23edb 100644 --- a/proto-lens-protoc/src/Data/ProtoLens/Compiler/Generate.hs +++ b/proto-lens-protoc/src/Data/ProtoLens/Compiler/Generate.hs @@ -114,7 +114,7 @@ generateModule modName imports syntaxType modifyImport definitions importedEnv s sharedImports = map (modifyImport . importSimple) [ "Prelude", "Data.Int", "Data.Word" , "Data.ProtoLens", "Data.ProtoLens.Message.Enum", "Data.ProtoLens.Service.Types" - , "Lens.Family2", "Lens.Family2.Unchecked", "Data.Default.Class" + , "Lens.Family2", "Lens.Family2.Unchecked" , "Data.Text", "Data.Map", "Data.ByteString", "Data.ByteString.Char8" , "Lens.Labels", "Text.Read" ] @@ -302,26 +302,8 @@ generateMessageDecls fieldModName syntaxType env protoName info = , let sym = promoteSymbol $ lensSymbol i ] ++ - -- instance Data.Default.Class.Default Bar where - [ uncommented $ instDecl [] ("Data.Default.Class.Default" `ihApp` [dataType]) - -- def = Bar { _Bar_foo = 0 } - [ - [ match "def" [] - $ recConstr (unQual dataName) $ - [ fieldUpdate (unQual $ haskellRecordFieldName $ plainFieldName f) - (hsFieldDefault syntaxType env (fieldDescriptor f)) - | f <- messageFields info - ] ++ - [ fieldUpdate (unQual $ haskellRecordFieldName $ oneofFieldName o) - "Prelude.Nothing" - | o <- messageOneofFields info - ] ++ - [ fieldUpdate (unQual $ messageUnknownFields info) - "[]"] - ] - ] -- instance Message.Message Bar where - , uncommented $ instDecl [] ("Data.ProtoLens.Message" `ihApp` [dataType]) + [ uncommented $ instDecl [] ("Data.ProtoLens.Message" `ihApp` [dataType]) $ messageInstance syntaxType env protoName info ] where @@ -523,10 +505,6 @@ generateEnumDecls Proto3 info = "Data.ProtoLens.Message.Enum.messageEnumFromThenTo" ] - -- instance Data.Default.Class.Default Foo where - -- def = FirstEnumValue - , instDecl [] ("Data.Default.Class.Default" `ihApp` [dataType]) - [[match "def" [] defaultCon]] -- instance Data.ProtoLens.FieldDefault Foo where -- fieldDefault = FirstEnumValue , instDecl [] ("Data.ProtoLens.FieldDefault" `ihApp` [dataType]) @@ -601,10 +579,6 @@ generateEnumDecls Proto2 info = [ dataDecl dataName [conDecl n [] | n <- constructorNames] $ deriving' ["Prelude.Show", "Prelude.Eq", "Prelude.Ord"] - -- instance Data.Default.Class.Default Foo where - -- def = FirstEnumValue - , instDecl [] ("Data.Default.Class.Default" `ihApp` [dataType]) - [[match "def" [] defaultCon]] -- instance Data.ProtoLens.FieldDefault Foo where -- fieldDefault = FirstEnumValue , instDecl [] ("Data.ProtoLens.FieldDefault" `ihApp` [dataType]) @@ -949,10 +923,10 @@ hsFieldDefault syntaxType env fd hsFieldValueDefault :: Env QName -> FieldDescriptorProto -> Exp hsFieldValueDefault env fd = case fd ^. type' of - FieldDescriptorProto'TYPE_MESSAGE -> "Data.Default.Class.def" - FieldDescriptorProto'TYPE_GROUP -> "Data.Default.Class.def" + FieldDescriptorProto'TYPE_MESSAGE -> "Data.ProtoLens.defaultMessage" + FieldDescriptorProto'TYPE_GROUP -> "Data.ProtoLens.defaultMessage" FieldDescriptorProto'TYPE_ENUM - | T.null def -> "Data.Default.Class.def" + | T.null def -> "Data.ProtoLens.fieldDefault" | Enum e <- definedFieldType fd env , Just v <- List.lookup def [ (enumValueDescriptor v ^. name, enumValueName v) | v <- enumValues e @@ -1047,6 +1021,19 @@ messageInstance syntaxType env protoName m = let' (map (fieldDescriptorVarBind $ messageName m) $ fields) $ "Data.Map.fromList" @@ list fieldsByTag ] , [ match "unknownFields" [] $ rawFieldAccessor (unQual $ messageUnknownFields m) ] + , [ match "defaultMessage" [] + $ recConstr (unQual $ messageName m) $ + [ fieldUpdate (unQual $ haskellRecordFieldName $ plainFieldName f) + (hsFieldDefault syntaxType env (fieldDescriptor f)) + | f <- messageFields m + ] ++ + [ fieldUpdate (unQual $ haskellRecordFieldName $ oneofFieldName o) + "Prelude.Nothing" + | o <- messageOneofFields m + ] ++ + [ fieldUpdate (unQual $ messageUnknownFields m) + "[]"] + ] ] where fieldsByTag = diff --git a/proto-lens-tests/package.yaml b/proto-lens-tests/package.yaml index 18c26fe9..2465e6b7 100644 --- a/proto-lens-tests/package.yaml +++ b/proto-lens-tests/package.yaml @@ -22,7 +22,6 @@ dependencies: - QuickCheck - base - bytestring - - data-default-class - lens-family - pretty - proto-lens diff --git a/proto-lens-tests/tests/imports_test.hs b/proto-lens-tests/tests/imports_test.hs index 32dba3fc..c86b16a0 100644 --- a/proto-lens-tests/tests/imports_test.hs +++ b/proto-lens-tests/tests/imports_test.hs @@ -4,7 +4,7 @@ {-# LANGUAGE TypeApplications #-} module Main where -import Data.Default.Class (Default(def)) +import Data.ProtoLens (Message, def) import Lens.Labels (Lens', view, set) import Test.Framework.Providers.HUnit (testCase) import Test.HUnit ((@=?)) @@ -30,7 +30,7 @@ main = testMain -- (In this test, we're checking that the sub-field type got imported -- correctly from another file.) testField - :: forall a b . (Default a, Default b, Eq b, Show b) + :: forall a b . (Message a, Message b, Eq b, Show b) => Lens' a b -> IO () testField f = def @=? view f (set f def def) diff --git a/proto-lens-tests/tests/labels_test.hs b/proto-lens-tests/tests/labels_test.hs index e5855edc..4b56a45a 100644 --- a/proto-lens-tests/tests/labels_test.hs +++ b/proto-lens-tests/tests/labels_test.hs @@ -8,8 +8,7 @@ import qualified Lens.Family2 import qualified Lens.Family import Proto.Canonical (Test1, Test3) -import Data.Default.Class (def) -import Data.ProtoLens (build) +import Data.ProtoLens (build, def) import Data.ProtoLens.TestUtil import Test.HUnit ((@?=)) import Test.Framework.Providers.HUnit (testCase) diff --git a/proto-lens-tests/tests/required_test.hs b/proto-lens-tests/tests/required_test.hs index 034f2bd0..87f6d4c0 100644 --- a/proto-lens-tests/tests/required_test.hs +++ b/proto-lens-tests/tests/required_test.hs @@ -7,8 +7,8 @@ {-# LANGUAGE OverloadedStrings #-} module Main where -import Data.Default.Class (def) import Data.Monoid ((<>)) +import Data.ProtoLens (def) import Lens.Family ((&), (.~)) import Proto.Required (Foo) import Proto.Required_Fields (a, b) diff --git a/proto-lens-tests/tests/unwrapped_test.hs b/proto-lens-tests/tests/unwrapped_test.hs index 261aa6f0..6b0955d9 100644 --- a/proto-lens-tests/tests/unwrapped_test.hs +++ b/proto-lens-tests/tests/unwrapped_test.hs @@ -8,8 +8,7 @@ import Lens.Family ((&), (.~), (^.)) import Lens.Labels.Unwrapped () import Proto.Canonical (Test3) -import Data.Default.Class (def) -import Data.ProtoLens (build) +import Data.ProtoLens (build, def) import Data.ProtoLens.TestUtil import Test.HUnit ((@?=)) import Test.Framework.Providers.HUnit (testCase) diff --git a/proto-lens/package.yaml b/proto-lens/package.yaml index 57dacbef..a4f7b5be 100644 --- a/proto-lens/package.yaml +++ b/proto-lens/package.yaml @@ -50,7 +50,6 @@ library: - bytestring == 0.10.* - containers == 0.5.* - deepseq == 1.4.* - - data-default-class >= 0.0 && < 0.2 - lens-family == 1.2.* - lens-labels == 0.2.* - parsec == 3.1.* diff --git a/proto-lens/src/Data/ProtoLens/Message.hs b/proto-lens/src/Data/ProtoLens/Message.hs index d4fae439..75ce81cd 100644 --- a/proto-lens/src/Data/ProtoLens/Message.hs +++ b/proto-lens/src/Data/ProtoLens/Message.hs @@ -30,7 +30,7 @@ module Data.ProtoLens.Message ( FieldDefault(..), MessageEnum(..), -- * Building protocol buffers - Default(..), + def, build, -- * Proto registries Registry, @@ -51,7 +51,6 @@ module Data.ProtoLens.Message ( ) where import qualified Data.ByteString as B -import Data.Default.Class import Data.Int import qualified Data.Map as Map import Data.Map (Map) @@ -71,12 +70,19 @@ import Data.ProtoLens.Encoding.Wire -- | Every protocol buffer is an instance of 'Message'. This class enables -- serialization by providing reflection of all of the fields that may be used -- by this type. -class Default msg => Message msg where +class Message msg where -- | A unique identifier for this type, of the format -- @"packagename.messagename"@. messageName :: Proxy msg -> T.Text + + -- | A message with all fields set to their default values. + -- + -- Satisfies @encodeMessage defaultMessage == ""@ and @decodeMessage "" == Right defaultMessage@. + defaultMessage :: msg + -- | The fields of the proto, indexed by their (integer) tag. fieldsByTag :: Map Tag (FieldDescriptor msg) + -- | This map is keyed by the name of the field used for text format protos. -- This is just the field name for every field except for group fields, -- which use their Message type name in text protos instead of their @@ -85,6 +91,7 @@ class Default msg => Message msg where fieldsByTextFormatName :: Map String (FieldDescriptor msg) fieldsByTextFormatName = Map.fromList [(n, f) | f@(FieldDescriptor n _ _) <- allFields] + -- | Access the unknown fields of a Message. unknownFields :: Lens' msg FieldSet @@ -142,8 +149,9 @@ data WireDefault value where -- | A proto3 field type with an implicit default value. -- --- This is distinct from 'Data.Default' to avoid orphan instances, and because --- 'Bool' doesn't necessarily have a good Default instance for general usage. +-- This is distinct from, say, 'Data.Default' to avoid orphan instances, and +-- because 'Bool' doesn't necessarily have a good Default instance for general +-- usage. class FieldDefault value where fieldDefault :: value @@ -236,6 +244,12 @@ class (Enum a, Bounded a) => MessageEnum a where -- no corresponding value was defined in the .proto file. readEnum :: String -> Maybe a +-- | A message with all fields set to their default values. +-- +-- This is an elided version 'defaultMessage'. +def :: Message a => a +def = defaultMessage + -- | Utility function for building a message from a default value. -- For example: -- @@ -243,7 +257,7 @@ class (Enum a, Bounded a) => MessageEnum a where -- > x, y :: Lens' A Int -- > m :: A -- > m = build ((x .~ 5) . (y .~ 7)) -build :: Default a => (a -> a) -> a +build :: Message a => (a -> a) -> a build = ($ def) -- | A helper lens for accessing optional fields. diff --git a/proto-lens/src/Proto/Google/Protobuf/Compiler/Plugin.hs b/proto-lens/src/Proto/Google/Protobuf/Compiler/Plugin.hs index ecd723a2..fce60244 100644 --- a/proto-lens/src/Proto/Google/Protobuf/Compiler/Plugin.hs +++ b/proto-lens/src/Proto/Google/Protobuf/Compiler/Plugin.hs @@ -18,7 +18,6 @@ import qualified Data.ProtoLens.Message.Enum import qualified Data.ProtoLens.Service.Types import qualified Lens.Family2 import qualified Lens.Family2.Unchecked -import qualified Data.Default.Class import qualified Data.Text import qualified Data.Map import qualified Data.ByteString @@ -86,12 +85,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _CodeGeneratorRequest'protoFile (\ x__ y__ -> x__{_CodeGeneratorRequest'protoFile = y__})) Prelude.id -instance Data.Default.Class.Default CodeGeneratorRequest where - def - = CodeGeneratorRequest{_CodeGeneratorRequest'fileToGenerate = [], - _CodeGeneratorRequest'parameter = Prelude.Nothing, - _CodeGeneratorRequest'protoFile = [], - _CodeGeneratorRequest'_unknownFields = ([])} instance Data.ProtoLens.Message CodeGeneratorRequest where messageName _ = Data.Text.pack "google.protobuf.compiler.CodeGeneratorRequest" @@ -129,6 +122,11 @@ instance Data.ProtoLens.Message CodeGeneratorRequest where unknownFields = Lens.Family2.Unchecked.lens _CodeGeneratorRequest'_unknownFields (\ x__ y__ -> x__{_CodeGeneratorRequest'_unknownFields = y__}) + defaultMessage + = CodeGeneratorRequest{_CodeGeneratorRequest'fileToGenerate = [], + _CodeGeneratorRequest'parameter = Prelude.Nothing, + _CodeGeneratorRequest'protoFile = [], + _CodeGeneratorRequest'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Compiler.Plugin_Fields.error' @:: Lens' CodeGeneratorResponse Data.Text.Text@ @@ -176,12 +174,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _CodeGeneratorResponse'file (\ x__ y__ -> x__{_CodeGeneratorResponse'file = y__})) Prelude.id -instance Data.Default.Class.Default CodeGeneratorResponse where - def - = CodeGeneratorResponse{_CodeGeneratorResponse'error = - Prelude.Nothing, - _CodeGeneratorResponse'file = [], - _CodeGeneratorResponse'_unknownFields = ([])} instance Data.ProtoLens.Message CodeGeneratorResponse where messageName _ = Data.Text.pack "google.protobuf.compiler.CodeGeneratorResponse" @@ -209,6 +201,11 @@ instance Data.ProtoLens.Message CodeGeneratorResponse where unknownFields = Lens.Family2.Unchecked.lens _CodeGeneratorResponse'_unknownFields (\ x__ y__ -> x__{_CodeGeneratorResponse'_unknownFields = y__}) + defaultMessage + = CodeGeneratorResponse{_CodeGeneratorResponse'error = + Prelude.Nothing, + _CodeGeneratorResponse'file = [], + _CodeGeneratorResponse'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Compiler.Plugin_Fields.name' @:: Lens' CodeGeneratorResponse'File Data.Text.Text@ @@ -295,14 +292,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _CodeGeneratorResponse'File'content (\ x__ y__ -> x__{_CodeGeneratorResponse'File'content = y__})) Prelude.id -instance Data.Default.Class.Default CodeGeneratorResponse'File - where - def - = CodeGeneratorResponse'File{_CodeGeneratorResponse'File'name = - Prelude.Nothing, - _CodeGeneratorResponse'File'insertionPoint = Prelude.Nothing, - _CodeGeneratorResponse'File'content = Prelude.Nothing, - _CodeGeneratorResponse'File'_unknownFields = ([])} instance Data.ProtoLens.Message CodeGeneratorResponse'File where messageName _ = Data.Text.pack @@ -342,4 +331,10 @@ instance Data.ProtoLens.Message CodeGeneratorResponse'File where = Lens.Family2.Unchecked.lens _CodeGeneratorResponse'File'_unknownFields (\ x__ y__ -> - x__{_CodeGeneratorResponse'File'_unknownFields = y__}) \ No newline at end of file + x__{_CodeGeneratorResponse'File'_unknownFields = y__}) + defaultMessage + = CodeGeneratorResponse'File{_CodeGeneratorResponse'File'name = + Prelude.Nothing, + _CodeGeneratorResponse'File'insertionPoint = Prelude.Nothing, + _CodeGeneratorResponse'File'content = Prelude.Nothing, + _CodeGeneratorResponse'File'_unknownFields = ([])} \ No newline at end of file diff --git a/proto-lens/src/Proto/Google/Protobuf/Compiler/Plugin_Fields.hs b/proto-lens/src/Proto/Google/Protobuf/Compiler/Plugin_Fields.hs index 49673976..854807e7 100644 --- a/proto-lens/src/Proto/Google/Protobuf/Compiler/Plugin_Fields.hs +++ b/proto-lens/src/Proto/Google/Protobuf/Compiler/Plugin_Fields.hs @@ -14,7 +14,6 @@ import qualified Data.ProtoLens.Message.Enum import qualified Data.ProtoLens.Service.Types import qualified Lens.Family2 import qualified Lens.Family2.Unchecked -import qualified Data.Default.Class import qualified Data.Text import qualified Data.Map import qualified Data.ByteString diff --git a/proto-lens/src/Proto/Google/Protobuf/Descriptor.hs b/proto-lens/src/Proto/Google/Protobuf/Descriptor.hs index e69243b7..596e8fdb 100644 --- a/proto-lens/src/Proto/Google/Protobuf/Descriptor.hs +++ b/proto-lens/src/Proto/Google/Protobuf/Descriptor.hs @@ -32,7 +32,6 @@ import qualified Data.ProtoLens.Message.Enum import qualified Data.ProtoLens.Service.Types import qualified Lens.Family2 import qualified Lens.Family2.Unchecked -import qualified Data.Default.Class import qualified Data.Text import qualified Data.Map import qualified Data.ByteString @@ -152,7 +151,7 @@ instance Prelude.Functor f => = (Prelude..) (Lens.Family2.Unchecked.lens _DescriptorProto'options (\ x__ y__ -> x__{_DescriptorProto'options = y__})) - (Data.ProtoLens.maybeLens Data.Default.Class.def) + (Data.ProtoLens.maybeLens Data.ProtoLens.defaultMessage) instance Prelude.Functor f => Lens.Labels.HasLens' f DescriptorProto "maybe'options" (Prelude.Maybe MessageOptions) @@ -180,17 +179,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _DescriptorProto'reservedName (\ x__ y__ -> x__{_DescriptorProto'reservedName = y__})) Prelude.id -instance Data.Default.Class.Default DescriptorProto where - def - = DescriptorProto{_DescriptorProto'name = Prelude.Nothing, - _DescriptorProto'field = [], _DescriptorProto'extension = [], - _DescriptorProto'nestedType = [], _DescriptorProto'enumType = [], - _DescriptorProto'extensionRange = [], - _DescriptorProto'oneofDecl = [], - _DescriptorProto'options = Prelude.Nothing, - _DescriptorProto'reservedRange = [], - _DescriptorProto'reservedName = [], - _DescriptorProto'_unknownFields = ([])} instance Data.ProtoLens.Message DescriptorProto where messageName _ = Data.Text.pack "google.protobuf.DescriptorProto" fieldsByTag @@ -289,6 +277,16 @@ instance Data.ProtoLens.Message DescriptorProto where unknownFields = Lens.Family2.Unchecked.lens _DescriptorProto'_unknownFields (\ x__ y__ -> x__{_DescriptorProto'_unknownFields = y__}) + defaultMessage + = DescriptorProto{_DescriptorProto'name = Prelude.Nothing, + _DescriptorProto'field = [], _DescriptorProto'extension = [], + _DescriptorProto'nestedType = [], _DescriptorProto'enumType = [], + _DescriptorProto'extensionRange = [], + _DescriptorProto'oneofDecl = [], + _DescriptorProto'options = Prelude.Nothing, + _DescriptorProto'reservedRange = [], + _DescriptorProto'reservedName = [], + _DescriptorProto'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.start' @:: Lens' DescriptorProto'ExtensionRange Data.Int.Int32@ @@ -353,13 +351,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _DescriptorProto'ExtensionRange'end (\ x__ y__ -> x__{_DescriptorProto'ExtensionRange'end = y__})) Prelude.id -instance Data.Default.Class.Default DescriptorProto'ExtensionRange - where - def - = DescriptorProto'ExtensionRange{_DescriptorProto'ExtensionRange'start - = Prelude.Nothing, - _DescriptorProto'ExtensionRange'end = Prelude.Nothing, - _DescriptorProto'ExtensionRange'_unknownFields = ([])} instance Data.ProtoLens.Message DescriptorProto'ExtensionRange where messageName _ @@ -390,6 +381,11 @@ instance Data.ProtoLens.Message DescriptorProto'ExtensionRange _DescriptorProto'ExtensionRange'_unknownFields (\ x__ y__ -> x__{_DescriptorProto'ExtensionRange'_unknownFields = y__}) + defaultMessage + = DescriptorProto'ExtensionRange{_DescriptorProto'ExtensionRange'start + = Prelude.Nothing, + _DescriptorProto'ExtensionRange'end = Prelude.Nothing, + _DescriptorProto'ExtensionRange'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.start' @:: Lens' DescriptorProto'ReservedRange Data.Int.Int32@ @@ -451,13 +447,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _DescriptorProto'ReservedRange'end (\ x__ y__ -> x__{_DescriptorProto'ReservedRange'end = y__})) Prelude.id -instance Data.Default.Class.Default DescriptorProto'ReservedRange - where - def - = DescriptorProto'ReservedRange{_DescriptorProto'ReservedRange'start - = Prelude.Nothing, - _DescriptorProto'ReservedRange'end = Prelude.Nothing, - _DescriptorProto'ReservedRange'_unknownFields = ([])} instance Data.ProtoLens.Message DescriptorProto'ReservedRange where messageName _ = Data.Text.pack "google.protobuf.DescriptorProto.ReservedRange" @@ -487,6 +476,11 @@ instance Data.ProtoLens.Message DescriptorProto'ReservedRange where _DescriptorProto'ReservedRange'_unknownFields (\ x__ y__ -> x__{_DescriptorProto'ReservedRange'_unknownFields = y__}) + defaultMessage + = DescriptorProto'ReservedRange{_DescriptorProto'ReservedRange'start + = Prelude.Nothing, + _DescriptorProto'ReservedRange'end = Prelude.Nothing, + _DescriptorProto'ReservedRange'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.name' @:: Lens' EnumDescriptorProto Data.Text.Text@ @@ -541,7 +535,7 @@ instance Prelude.Functor f => = (Prelude..) (Lens.Family2.Unchecked.lens _EnumDescriptorProto'options (\ x__ y__ -> x__{_EnumDescriptorProto'options = y__})) - (Data.ProtoLens.maybeLens Data.Default.Class.def) + (Data.ProtoLens.maybeLens Data.ProtoLens.defaultMessage) instance Prelude.Functor f => Lens.Labels.HasLens' f EnumDescriptorProto "maybe'options" (Prelude.Maybe EnumOptions) @@ -551,12 +545,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _EnumDescriptorProto'options (\ x__ y__ -> x__{_EnumDescriptorProto'options = y__})) Prelude.id -instance Data.Default.Class.Default EnumDescriptorProto where - def - = EnumDescriptorProto{_EnumDescriptorProto'name = Prelude.Nothing, - _EnumDescriptorProto'value = [], - _EnumDescriptorProto'options = Prelude.Nothing, - _EnumDescriptorProto'_unknownFields = ([])} instance Data.ProtoLens.Message EnumDescriptorProto where messageName _ = Data.Text.pack "google.protobuf.EnumDescriptorProto" @@ -593,6 +581,11 @@ instance Data.ProtoLens.Message EnumDescriptorProto where unknownFields = Lens.Family2.Unchecked.lens _EnumDescriptorProto'_unknownFields (\ x__ y__ -> x__{_EnumDescriptorProto'_unknownFields = y__}) + defaultMessage + = EnumDescriptorProto{_EnumDescriptorProto'name = Prelude.Nothing, + _EnumDescriptorProto'value = [], + _EnumDescriptorProto'options = Prelude.Nothing, + _EnumDescriptorProto'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.allowAlias' @:: Lens' EnumOptions Prelude.Bool@ @@ -654,12 +647,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _EnumOptions'uninterpretedOption (\ x__ y__ -> x__{_EnumOptions'uninterpretedOption = y__})) Prelude.id -instance Data.Default.Class.Default EnumOptions where - def - = EnumOptions{_EnumOptions'allowAlias = Prelude.Nothing, - _EnumOptions'deprecated = Prelude.Nothing, - _EnumOptions'uninterpretedOption = [], - _EnumOptions'_unknownFields = ([])} instance Data.ProtoLens.Message EnumOptions where messageName _ = Data.Text.pack "google.protobuf.EnumOptions" fieldsByTag @@ -696,6 +683,11 @@ instance Data.ProtoLens.Message EnumOptions where unknownFields = Lens.Family2.Unchecked.lens _EnumOptions'_unknownFields (\ x__ y__ -> x__{_EnumOptions'_unknownFields = y__}) + defaultMessage + = EnumOptions{_EnumOptions'allowAlias = Prelude.Nothing, + _EnumOptions'deprecated = Prelude.Nothing, + _EnumOptions'uninterpretedOption = [], + _EnumOptions'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.name' @:: Lens' EnumValueDescriptorProto Data.Text.Text@ @@ -767,7 +759,7 @@ instance Prelude.Functor f => = (Prelude..) (Lens.Family2.Unchecked.lens _EnumValueDescriptorProto'options (\ x__ y__ -> x__{_EnumValueDescriptorProto'options = y__})) - (Data.ProtoLens.maybeLens Data.Default.Class.def) + (Data.ProtoLens.maybeLens Data.ProtoLens.defaultMessage) instance Prelude.Functor f => Lens.Labels.HasLens' f EnumValueDescriptorProto "maybe'options" (Prelude.Maybe EnumValueOptions) @@ -777,13 +769,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _EnumValueDescriptorProto'options (\ x__ y__ -> x__{_EnumValueDescriptorProto'options = y__})) Prelude.id -instance Data.Default.Class.Default EnumValueDescriptorProto where - def - = EnumValueDescriptorProto{_EnumValueDescriptorProto'name = - Prelude.Nothing, - _EnumValueDescriptorProto'number = Prelude.Nothing, - _EnumValueDescriptorProto'options = Prelude.Nothing, - _EnumValueDescriptorProto'_unknownFields = ([])} instance Data.ProtoLens.Message EnumValueDescriptorProto where messageName _ = Data.Text.pack "google.protobuf.EnumValueDescriptorProto" @@ -821,6 +806,12 @@ instance Data.ProtoLens.Message EnumValueDescriptorProto where = Lens.Family2.Unchecked.lens _EnumValueDescriptorProto'_unknownFields (\ x__ y__ -> x__{_EnumValueDescriptorProto'_unknownFields = y__}) + defaultMessage + = EnumValueDescriptorProto{_EnumValueDescriptorProto'name = + Prelude.Nothing, + _EnumValueDescriptorProto'number = Prelude.Nothing, + _EnumValueDescriptorProto'options = Prelude.Nothing, + _EnumValueDescriptorProto'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.deprecated' @:: Lens' EnumValueOptions Prelude.Bool@ @@ -864,11 +855,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _EnumValueOptions'uninterpretedOption (\ x__ y__ -> x__{_EnumValueOptions'uninterpretedOption = y__})) Prelude.id -instance Data.Default.Class.Default EnumValueOptions where - def - = EnumValueOptions{_EnumValueOptions'deprecated = Prelude.Nothing, - _EnumValueOptions'uninterpretedOption = [], - _EnumValueOptions'_unknownFields = ([])} instance Data.ProtoLens.Message EnumValueOptions where messageName _ = Data.Text.pack "google.protobuf.EnumValueOptions" fieldsByTag @@ -896,6 +882,10 @@ instance Data.ProtoLens.Message EnumValueOptions where unknownFields = Lens.Family2.Unchecked.lens _EnumValueOptions'_unknownFields (\ x__ y__ -> x__{_EnumValueOptions'_unknownFields = y__}) + defaultMessage + = EnumValueOptions{_EnumValueOptions'deprecated = Prelude.Nothing, + _EnumValueOptions'uninterpretedOption = [], + _EnumValueOptions'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.name' @:: Lens' FieldDescriptorProto Data.Text.Text@ @@ -993,7 +983,7 @@ instance Prelude.Functor f => = (Prelude..) (Lens.Family2.Unchecked.lens _FieldDescriptorProto'label (\ x__ y__ -> x__{_FieldDescriptorProto'label = y__})) - (Data.ProtoLens.maybeLens Data.Default.Class.def) + (Data.ProtoLens.maybeLens Data.ProtoLens.fieldDefault) instance Prelude.Functor f => Lens.Labels.HasLens' f FieldDescriptorProto "maybe'label" (Prelude.Maybe FieldDescriptorProto'Label) @@ -1011,7 +1001,7 @@ instance Prelude.Functor f => = (Prelude..) (Lens.Family2.Unchecked.lens _FieldDescriptorProto'type' (\ x__ y__ -> x__{_FieldDescriptorProto'type' = y__})) - (Data.ProtoLens.maybeLens Data.Default.Class.def) + (Data.ProtoLens.maybeLens Data.ProtoLens.fieldDefault) instance Prelude.Functor f => Lens.Labels.HasLens' f FieldDescriptorProto "maybe'type'" (Prelude.Maybe FieldDescriptorProto'Type) @@ -1119,7 +1109,7 @@ instance Prelude.Functor f => = (Prelude..) (Lens.Family2.Unchecked.lens _FieldDescriptorProto'options (\ x__ y__ -> x__{_FieldDescriptorProto'options = y__})) - (Data.ProtoLens.maybeLens Data.Default.Class.def) + (Data.ProtoLens.maybeLens Data.ProtoLens.defaultMessage) instance Prelude.Functor f => Lens.Labels.HasLens' f FieldDescriptorProto "maybe'options" (Prelude.Maybe FieldOptions) @@ -1129,20 +1119,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _FieldDescriptorProto'options (\ x__ y__ -> x__{_FieldDescriptorProto'options = y__})) Prelude.id -instance Data.Default.Class.Default FieldDescriptorProto where - def - = FieldDescriptorProto{_FieldDescriptorProto'name = - Prelude.Nothing, - _FieldDescriptorProto'number = Prelude.Nothing, - _FieldDescriptorProto'label = Prelude.Nothing, - _FieldDescriptorProto'type' = Prelude.Nothing, - _FieldDescriptorProto'typeName = Prelude.Nothing, - _FieldDescriptorProto'extendee = Prelude.Nothing, - _FieldDescriptorProto'defaultValue = Prelude.Nothing, - _FieldDescriptorProto'oneofIndex = Prelude.Nothing, - _FieldDescriptorProto'jsonName = Prelude.Nothing, - _FieldDescriptorProto'options = Prelude.Nothing, - _FieldDescriptorProto'_unknownFields = ([])} instance Data.ProtoLens.Message FieldDescriptorProto where messageName _ = Data.Text.pack "google.protobuf.FieldDescriptorProto" @@ -1243,13 +1219,23 @@ instance Data.ProtoLens.Message FieldDescriptorProto where unknownFields = Lens.Family2.Unchecked.lens _FieldDescriptorProto'_unknownFields (\ x__ y__ -> x__{_FieldDescriptorProto'_unknownFields = y__}) + defaultMessage + = FieldDescriptorProto{_FieldDescriptorProto'name = + Prelude.Nothing, + _FieldDescriptorProto'number = Prelude.Nothing, + _FieldDescriptorProto'label = Prelude.Nothing, + _FieldDescriptorProto'type' = Prelude.Nothing, + _FieldDescriptorProto'typeName = Prelude.Nothing, + _FieldDescriptorProto'extendee = Prelude.Nothing, + _FieldDescriptorProto'defaultValue = Prelude.Nothing, + _FieldDescriptorProto'oneofIndex = Prelude.Nothing, + _FieldDescriptorProto'jsonName = Prelude.Nothing, + _FieldDescriptorProto'options = Prelude.Nothing, + _FieldDescriptorProto'_unknownFields = ([])} data FieldDescriptorProto'Label = FieldDescriptorProto'LABEL_OPTIONAL | FieldDescriptorProto'LABEL_REQUIRED | FieldDescriptorProto'LABEL_REPEATED deriving (Prelude.Show, Prelude.Eq, Prelude.Ord) -instance Data.Default.Class.Default FieldDescriptorProto'Label - where - def = FieldDescriptorProto'LABEL_OPTIONAL instance Data.ProtoLens.FieldDefault FieldDescriptorProto'Label where fieldDefault = FieldDescriptorProto'LABEL_OPTIONAL @@ -1320,8 +1306,6 @@ data FieldDescriptorProto'Type = FieldDescriptorProto'TYPE_DOUBLE | FieldDescriptorProto'TYPE_SINT32 | FieldDescriptorProto'TYPE_SINT64 deriving (Prelude.Show, Prelude.Eq, Prelude.Ord) -instance Data.Default.Class.Default FieldDescriptorProto'Type where - def = FieldDescriptorProto'TYPE_DOUBLE instance Data.ProtoLens.FieldDefault FieldDescriptorProto'Type where fieldDefault = FieldDescriptorProto'TYPE_DOUBLE @@ -1646,16 +1630,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _FieldOptions'uninterpretedOption (\ x__ y__ -> x__{_FieldOptions'uninterpretedOption = y__})) Prelude.id -instance Data.Default.Class.Default FieldOptions where - def - = FieldOptions{_FieldOptions'ctype = Prelude.Nothing, - _FieldOptions'packed = Prelude.Nothing, - _FieldOptions'jstype = Prelude.Nothing, - _FieldOptions'lazy = Prelude.Nothing, - _FieldOptions'deprecated = Prelude.Nothing, - _FieldOptions'weak = Prelude.Nothing, - _FieldOptions'uninterpretedOption = [], - _FieldOptions'_unknownFields = ([])} instance Data.ProtoLens.Message FieldOptions where messageName _ = Data.Text.pack "google.protobuf.FieldOptions" fieldsByTag @@ -1728,12 +1702,19 @@ instance Data.ProtoLens.Message FieldOptions where unknownFields = Lens.Family2.Unchecked.lens _FieldOptions'_unknownFields (\ x__ y__ -> x__{_FieldOptions'_unknownFields = y__}) + defaultMessage + = FieldOptions{_FieldOptions'ctype = Prelude.Nothing, + _FieldOptions'packed = Prelude.Nothing, + _FieldOptions'jstype = Prelude.Nothing, + _FieldOptions'lazy = Prelude.Nothing, + _FieldOptions'deprecated = Prelude.Nothing, + _FieldOptions'weak = Prelude.Nothing, + _FieldOptions'uninterpretedOption = [], + _FieldOptions'_unknownFields = ([])} data FieldOptions'CType = FieldOptions'STRING | FieldOptions'CORD | FieldOptions'STRING_PIECE deriving (Prelude.Show, Prelude.Eq, Prelude.Ord) -instance Data.Default.Class.Default FieldOptions'CType where - def = FieldOptions'STRING instance Data.ProtoLens.FieldDefault FieldOptions'CType where fieldDefault = FieldOptions'STRING instance Data.ProtoLens.MessageEnum FieldOptions'CType where @@ -1780,8 +1761,6 @@ data FieldOptions'JSType = FieldOptions'JS_NORMAL | FieldOptions'JS_STRING | FieldOptions'JS_NUMBER deriving (Prelude.Show, Prelude.Eq, Prelude.Ord) -instance Data.Default.Class.Default FieldOptions'JSType where - def = FieldOptions'JS_NORMAL instance Data.ProtoLens.FieldDefault FieldOptions'JSType where fieldDefault = FieldOptions'JS_NORMAL instance Data.ProtoLens.MessageEnum FieldOptions'JSType where @@ -1979,7 +1958,7 @@ instance Prelude.Functor f => = (Prelude..) (Lens.Family2.Unchecked.lens _FileDescriptorProto'options (\ x__ y__ -> x__{_FileDescriptorProto'options = y__})) - (Data.ProtoLens.maybeLens Data.Default.Class.def) + (Data.ProtoLens.maybeLens Data.ProtoLens.defaultMessage) instance Prelude.Functor f => Lens.Labels.HasLens' f FileDescriptorProto "maybe'options" (Prelude.Maybe FileOptions) @@ -1997,7 +1976,7 @@ instance Prelude.Functor f => = (Prelude..) (Lens.Family2.Unchecked.lens _FileDescriptorProto'sourceCodeInfo (\ x__ y__ -> x__{_FileDescriptorProto'sourceCodeInfo = y__})) - (Data.ProtoLens.maybeLens Data.Default.Class.def) + (Data.ProtoLens.maybeLens Data.ProtoLens.defaultMessage) instance Prelude.Functor f => Lens.Labels.HasLens' f FileDescriptorProto "maybe'sourceCodeInfo" (Prelude.Maybe SourceCodeInfo) @@ -2025,21 +2004,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _FileDescriptorProto'syntax (\ x__ y__ -> x__{_FileDescriptorProto'syntax = y__})) Prelude.id -instance Data.Default.Class.Default FileDescriptorProto where - def - = FileDescriptorProto{_FileDescriptorProto'name = Prelude.Nothing, - _FileDescriptorProto'package = Prelude.Nothing, - _FileDescriptorProto'dependency = [], - _FileDescriptorProto'publicDependency = [], - _FileDescriptorProto'weakDependency = [], - _FileDescriptorProto'messageType = [], - _FileDescriptorProto'enumType = [], - _FileDescriptorProto'service = [], - _FileDescriptorProto'extension = [], - _FileDescriptorProto'options = Prelude.Nothing, - _FileDescriptorProto'sourceCodeInfo = Prelude.Nothing, - _FileDescriptorProto'syntax = Prelude.Nothing, - _FileDescriptorProto'_unknownFields = ([])} instance Data.ProtoLens.Message FileDescriptorProto where messageName _ = Data.Text.pack "google.protobuf.FileDescriptorProto" @@ -2158,6 +2122,20 @@ instance Data.ProtoLens.Message FileDescriptorProto where unknownFields = Lens.Family2.Unchecked.lens _FileDescriptorProto'_unknownFields (\ x__ y__ -> x__{_FileDescriptorProto'_unknownFields = y__}) + defaultMessage + = FileDescriptorProto{_FileDescriptorProto'name = Prelude.Nothing, + _FileDescriptorProto'package = Prelude.Nothing, + _FileDescriptorProto'dependency = [], + _FileDescriptorProto'publicDependency = [], + _FileDescriptorProto'weakDependency = [], + _FileDescriptorProto'messageType = [], + _FileDescriptorProto'enumType = [], + _FileDescriptorProto'service = [], + _FileDescriptorProto'extension = [], + _FileDescriptorProto'options = Prelude.Nothing, + _FileDescriptorProto'sourceCodeInfo = Prelude.Nothing, + _FileDescriptorProto'syntax = Prelude.Nothing, + _FileDescriptorProto'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.file' @:: Lens' FileDescriptorSet [FileDescriptorProto]@ @@ -2180,10 +2158,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _FileDescriptorSet'file (\ x__ y__ -> x__{_FileDescriptorSet'file = y__})) Prelude.id -instance Data.Default.Class.Default FileDescriptorSet where - def - = FileDescriptorSet{_FileDescriptorSet'file = [], - _FileDescriptorSet'_unknownFields = ([])} instance Data.ProtoLens.Message FileDescriptorSet where messageName _ = Data.Text.pack "google.protobuf.FileDescriptorSet" fieldsByTag @@ -2200,6 +2174,9 @@ instance Data.ProtoLens.Message FileDescriptorSet where unknownFields = Lens.Family2.Unchecked.lens _FileDescriptorSet'_unknownFields (\ x__ y__ -> x__{_FileDescriptorSet'_unknownFields = y__}) + defaultMessage + = FileDescriptorSet{_FileDescriptorSet'file = [], + _FileDescriptorSet'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.javaPackage' @:: Lens' FileOptions Data.Text.Text@ @@ -2514,24 +2491,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _FileOptions'uninterpretedOption (\ x__ y__ -> x__{_FileOptions'uninterpretedOption = y__})) Prelude.id -instance Data.Default.Class.Default FileOptions where - def - = FileOptions{_FileOptions'javaPackage = Prelude.Nothing, - _FileOptions'javaOuterClassname = Prelude.Nothing, - _FileOptions'javaMultipleFiles = Prelude.Nothing, - _FileOptions'javaGenerateEqualsAndHash = Prelude.Nothing, - _FileOptions'javaStringCheckUtf8 = Prelude.Nothing, - _FileOptions'optimizeFor = Prelude.Nothing, - _FileOptions'goPackage = Prelude.Nothing, - _FileOptions'ccGenericServices = Prelude.Nothing, - _FileOptions'javaGenericServices = Prelude.Nothing, - _FileOptions'pyGenericServices = Prelude.Nothing, - _FileOptions'deprecated = Prelude.Nothing, - _FileOptions'ccEnableArenas = Prelude.Nothing, - _FileOptions'objcClassPrefix = Prelude.Nothing, - _FileOptions'csharpNamespace = Prelude.Nothing, - _FileOptions'uninterpretedOption = [], - _FileOptions'_unknownFields = ([])} instance Data.ProtoLens.Message FileOptions where messageName _ = Data.Text.pack "google.protobuf.FileOptions" fieldsByTag @@ -2689,12 +2648,27 @@ instance Data.ProtoLens.Message FileOptions where unknownFields = Lens.Family2.Unchecked.lens _FileOptions'_unknownFields (\ x__ y__ -> x__{_FileOptions'_unknownFields = y__}) + defaultMessage + = FileOptions{_FileOptions'javaPackage = Prelude.Nothing, + _FileOptions'javaOuterClassname = Prelude.Nothing, + _FileOptions'javaMultipleFiles = Prelude.Nothing, + _FileOptions'javaGenerateEqualsAndHash = Prelude.Nothing, + _FileOptions'javaStringCheckUtf8 = Prelude.Nothing, + _FileOptions'optimizeFor = Prelude.Nothing, + _FileOptions'goPackage = Prelude.Nothing, + _FileOptions'ccGenericServices = Prelude.Nothing, + _FileOptions'javaGenericServices = Prelude.Nothing, + _FileOptions'pyGenericServices = Prelude.Nothing, + _FileOptions'deprecated = Prelude.Nothing, + _FileOptions'ccEnableArenas = Prelude.Nothing, + _FileOptions'objcClassPrefix = Prelude.Nothing, + _FileOptions'csharpNamespace = Prelude.Nothing, + _FileOptions'uninterpretedOption = [], + _FileOptions'_unknownFields = ([])} data FileOptions'OptimizeMode = FileOptions'SPEED | FileOptions'CODE_SIZE | FileOptions'LITE_RUNTIME deriving (Prelude.Show, Prelude.Eq, Prelude.Ord) -instance Data.Default.Class.Default FileOptions'OptimizeMode where - def = FileOptions'SPEED instance Data.ProtoLens.FieldDefault FileOptions'OptimizeMode where fieldDefault = FileOptions'SPEED instance Data.ProtoLens.MessageEnum FileOptions'OptimizeMode where @@ -2759,10 +2733,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _GeneratedCodeInfo'annotation (\ x__ y__ -> x__{_GeneratedCodeInfo'annotation = y__})) Prelude.id -instance Data.Default.Class.Default GeneratedCodeInfo where - def - = GeneratedCodeInfo{_GeneratedCodeInfo'annotation = [], - _GeneratedCodeInfo'_unknownFields = ([])} instance Data.ProtoLens.Message GeneratedCodeInfo where messageName _ = Data.Text.pack "google.protobuf.GeneratedCodeInfo" fieldsByTag @@ -2780,6 +2750,9 @@ instance Data.ProtoLens.Message GeneratedCodeInfo where unknownFields = Lens.Family2.Unchecked.lens _GeneratedCodeInfo'_unknownFields (\ x__ y__ -> x__{_GeneratedCodeInfo'_unknownFields = y__}) + defaultMessage + = GeneratedCodeInfo{_GeneratedCodeInfo'annotation = [], + _GeneratedCodeInfo'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.path' @:: Lens' GeneratedCodeInfo'Annotation [Data.Int.Int32]@ @@ -2876,15 +2849,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _GeneratedCodeInfo'Annotation'end (\ x__ y__ -> x__{_GeneratedCodeInfo'Annotation'end = y__})) Prelude.id -instance Data.Default.Class.Default GeneratedCodeInfo'Annotation - where - def - = GeneratedCodeInfo'Annotation{_GeneratedCodeInfo'Annotation'path = - [], - _GeneratedCodeInfo'Annotation'sourceFile = Prelude.Nothing, - _GeneratedCodeInfo'Annotation'begin = Prelude.Nothing, - _GeneratedCodeInfo'Annotation'end = Prelude.Nothing, - _GeneratedCodeInfo'Annotation'_unknownFields = ([])} instance Data.ProtoLens.Message GeneratedCodeInfo'Annotation where messageName _ = Data.Text.pack "google.protobuf.GeneratedCodeInfo.Annotation" @@ -2932,6 +2896,13 @@ instance Data.ProtoLens.Message GeneratedCodeInfo'Annotation where _GeneratedCodeInfo'Annotation'_unknownFields (\ x__ y__ -> x__{_GeneratedCodeInfo'Annotation'_unknownFields = y__}) + defaultMessage + = GeneratedCodeInfo'Annotation{_GeneratedCodeInfo'Annotation'path = + [], + _GeneratedCodeInfo'Annotation'sourceFile = Prelude.Nothing, + _GeneratedCodeInfo'Annotation'begin = Prelude.Nothing, + _GeneratedCodeInfo'Annotation'end = Prelude.Nothing, + _GeneratedCodeInfo'Annotation'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.messageSetWireFormat' @:: Lens' MessageOptions Prelude.Bool@ @@ -3042,15 +3013,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _MessageOptions'uninterpretedOption (\ x__ y__ -> x__{_MessageOptions'uninterpretedOption = y__})) Prelude.id -instance Data.Default.Class.Default MessageOptions where - def - = MessageOptions{_MessageOptions'messageSetWireFormat = - Prelude.Nothing, - _MessageOptions'noStandardDescriptorAccessor = Prelude.Nothing, - _MessageOptions'deprecated = Prelude.Nothing, - _MessageOptions'mapEntry = Prelude.Nothing, - _MessageOptions'uninterpretedOption = [], - _MessageOptions'_unknownFields = ([])} instance Data.ProtoLens.Message MessageOptions where messageName _ = Data.Text.pack "google.protobuf.MessageOptions" fieldsByTag @@ -3108,6 +3070,14 @@ instance Data.ProtoLens.Message MessageOptions where unknownFields = Lens.Family2.Unchecked.lens _MessageOptions'_unknownFields (\ x__ y__ -> x__{_MessageOptions'_unknownFields = y__}) + defaultMessage + = MessageOptions{_MessageOptions'messageSetWireFormat = + Prelude.Nothing, + _MessageOptions'noStandardDescriptorAccessor = Prelude.Nothing, + _MessageOptions'deprecated = Prelude.Nothing, + _MessageOptions'mapEntry = Prelude.Nothing, + _MessageOptions'uninterpretedOption = [], + _MessageOptions'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.name' @:: Lens' MethodDescriptorProto Data.Text.Text@ @@ -3207,7 +3177,7 @@ instance Prelude.Functor f => = (Prelude..) (Lens.Family2.Unchecked.lens _MethodDescriptorProto'options (\ x__ y__ -> x__{_MethodDescriptorProto'options = y__})) - (Data.ProtoLens.maybeLens Data.Default.Class.def) + (Data.ProtoLens.maybeLens Data.ProtoLens.defaultMessage) instance Prelude.Functor f => Lens.Labels.HasLens' f MethodDescriptorProto "maybe'options" (Prelude.Maybe MethodOptions) @@ -3255,16 +3225,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _MethodDescriptorProto'serverStreaming (\ x__ y__ -> x__{_MethodDescriptorProto'serverStreaming = y__})) Prelude.id -instance Data.Default.Class.Default MethodDescriptorProto where - def - = MethodDescriptorProto{_MethodDescriptorProto'name = - Prelude.Nothing, - _MethodDescriptorProto'inputType = Prelude.Nothing, - _MethodDescriptorProto'outputType = Prelude.Nothing, - _MethodDescriptorProto'options = Prelude.Nothing, - _MethodDescriptorProto'clientStreaming = Prelude.Nothing, - _MethodDescriptorProto'serverStreaming = Prelude.Nothing, - _MethodDescriptorProto'_unknownFields = ([])} instance Data.ProtoLens.Message MethodDescriptorProto where messageName _ = Data.Text.pack "google.protobuf.MethodDescriptorProto" @@ -3330,6 +3290,15 @@ instance Data.ProtoLens.Message MethodDescriptorProto where unknownFields = Lens.Family2.Unchecked.lens _MethodDescriptorProto'_unknownFields (\ x__ y__ -> x__{_MethodDescriptorProto'_unknownFields = y__}) + defaultMessage + = MethodDescriptorProto{_MethodDescriptorProto'name = + Prelude.Nothing, + _MethodDescriptorProto'inputType = Prelude.Nothing, + _MethodDescriptorProto'outputType = Prelude.Nothing, + _MethodDescriptorProto'options = Prelude.Nothing, + _MethodDescriptorProto'clientStreaming = Prelude.Nothing, + _MethodDescriptorProto'serverStreaming = Prelude.Nothing, + _MethodDescriptorProto'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.deprecated' @:: Lens' MethodOptions Prelude.Bool@ @@ -3371,11 +3340,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _MethodOptions'uninterpretedOption (\ x__ y__ -> x__{_MethodOptions'uninterpretedOption = y__})) Prelude.id -instance Data.Default.Class.Default MethodOptions where - def - = MethodOptions{_MethodOptions'deprecated = Prelude.Nothing, - _MethodOptions'uninterpretedOption = [], - _MethodOptions'_unknownFields = ([])} instance Data.ProtoLens.Message MethodOptions where messageName _ = Data.Text.pack "google.protobuf.MethodOptions" fieldsByTag @@ -3403,6 +3367,10 @@ instance Data.ProtoLens.Message MethodOptions where unknownFields = Lens.Family2.Unchecked.lens _MethodOptions'_unknownFields (\ x__ y__ -> x__{_MethodOptions'_unknownFields = y__}) + defaultMessage + = MethodOptions{_MethodOptions'deprecated = Prelude.Nothing, + _MethodOptions'uninterpretedOption = [], + _MethodOptions'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.name' @:: Lens' OneofDescriptorProto Data.Text.Text@ @@ -3436,11 +3404,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _OneofDescriptorProto'name (\ x__ y__ -> x__{_OneofDescriptorProto'name = y__})) Prelude.id -instance Data.Default.Class.Default OneofDescriptorProto where - def - = OneofDescriptorProto{_OneofDescriptorProto'name = - Prelude.Nothing, - _OneofDescriptorProto'_unknownFields = ([])} instance Data.ProtoLens.Message OneofDescriptorProto where messageName _ = Data.Text.pack "google.protobuf.OneofDescriptorProto" @@ -3458,6 +3421,10 @@ instance Data.ProtoLens.Message OneofDescriptorProto where unknownFields = Lens.Family2.Unchecked.lens _OneofDescriptorProto'_unknownFields (\ x__ y__ -> x__{_OneofDescriptorProto'_unknownFields = y__}) + defaultMessage + = OneofDescriptorProto{_OneofDescriptorProto'name = + Prelude.Nothing, + _OneofDescriptorProto'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.name' @:: Lens' ServiceDescriptorProto Data.Text.Text@ @@ -3518,7 +3485,7 @@ instance Prelude.Functor f => = (Prelude..) (Lens.Family2.Unchecked.lens _ServiceDescriptorProto'options (\ x__ y__ -> x__{_ServiceDescriptorProto'options = y__})) - (Data.ProtoLens.maybeLens Data.Default.Class.def) + (Data.ProtoLens.maybeLens Data.ProtoLens.defaultMessage) instance Prelude.Functor f => Lens.Labels.HasLens' f ServiceDescriptorProto "maybe'options" (Prelude.Maybe ServiceOptions) @@ -3528,13 +3495,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _ServiceDescriptorProto'options (\ x__ y__ -> x__{_ServiceDescriptorProto'options = y__})) Prelude.id -instance Data.Default.Class.Default ServiceDescriptorProto where - def - = ServiceDescriptorProto{_ServiceDescriptorProto'name = - Prelude.Nothing, - _ServiceDescriptorProto'method = [], - _ServiceDescriptorProto'options = Prelude.Nothing, - _ServiceDescriptorProto'_unknownFields = ([])} instance Data.ProtoLens.Message ServiceDescriptorProto where messageName _ = Data.Text.pack "google.protobuf.ServiceDescriptorProto" @@ -3572,6 +3532,12 @@ instance Data.ProtoLens.Message ServiceDescriptorProto where = Lens.Family2.Unchecked.lens _ServiceDescriptorProto'_unknownFields (\ x__ y__ -> x__{_ServiceDescriptorProto'_unknownFields = y__}) + defaultMessage + = ServiceDescriptorProto{_ServiceDescriptorProto'name = + Prelude.Nothing, + _ServiceDescriptorProto'method = [], + _ServiceDescriptorProto'options = Prelude.Nothing, + _ServiceDescriptorProto'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.deprecated' @:: Lens' ServiceOptions Prelude.Bool@ @@ -3613,11 +3579,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _ServiceOptions'uninterpretedOption (\ x__ y__ -> x__{_ServiceOptions'uninterpretedOption = y__})) Prelude.id -instance Data.Default.Class.Default ServiceOptions where - def - = ServiceOptions{_ServiceOptions'deprecated = Prelude.Nothing, - _ServiceOptions'uninterpretedOption = [], - _ServiceOptions'_unknownFields = ([])} instance Data.ProtoLens.Message ServiceOptions where messageName _ = Data.Text.pack "google.protobuf.ServiceOptions" fieldsByTag @@ -3645,6 +3606,10 @@ instance Data.ProtoLens.Message ServiceOptions where unknownFields = Lens.Family2.Unchecked.lens _ServiceOptions'_unknownFields (\ x__ y__ -> x__{_ServiceOptions'_unknownFields = y__}) + defaultMessage + = ServiceOptions{_ServiceOptions'deprecated = Prelude.Nothing, + _ServiceOptions'uninterpretedOption = [], + _ServiceOptions'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.location' @:: Lens' SourceCodeInfo [SourceCodeInfo'Location]@ @@ -3666,10 +3631,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _SourceCodeInfo'location (\ x__ y__ -> x__{_SourceCodeInfo'location = y__})) Prelude.id -instance Data.Default.Class.Default SourceCodeInfo where - def - = SourceCodeInfo{_SourceCodeInfo'location = [], - _SourceCodeInfo'_unknownFields = ([])} instance Data.ProtoLens.Message SourceCodeInfo where messageName _ = Data.Text.pack "google.protobuf.SourceCodeInfo" fieldsByTag @@ -3687,6 +3648,9 @@ instance Data.ProtoLens.Message SourceCodeInfo where unknownFields = Lens.Family2.Unchecked.lens _SourceCodeInfo'_unknownFields (\ x__ y__ -> x__{_SourceCodeInfo'_unknownFields = y__}) + defaultMessage + = SourceCodeInfo{_SourceCodeInfo'location = [], + _SourceCodeInfo'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.path' @:: Lens' SourceCodeInfo'Location [Data.Int.Int32]@ @@ -3793,14 +3757,6 @@ instance Prelude.Functor f => (\ x__ y__ -> x__{_SourceCodeInfo'Location'leadingDetachedComments = y__})) Prelude.id -instance Data.Default.Class.Default SourceCodeInfo'Location where - def - = SourceCodeInfo'Location{_SourceCodeInfo'Location'path = [], - _SourceCodeInfo'Location'span = [], - _SourceCodeInfo'Location'leadingComments = Prelude.Nothing, - _SourceCodeInfo'Location'trailingComments = Prelude.Nothing, - _SourceCodeInfo'Location'leadingDetachedComments = [], - _SourceCodeInfo'Location'_unknownFields = ([])} instance Data.ProtoLens.Message SourceCodeInfo'Location where messageName _ = Data.Text.pack "google.protobuf.SourceCodeInfo.Location" @@ -3859,6 +3815,13 @@ instance Data.ProtoLens.Message SourceCodeInfo'Location where = Lens.Family2.Unchecked.lens _SourceCodeInfo'Location'_unknownFields (\ x__ y__ -> x__{_SourceCodeInfo'Location'_unknownFields = y__}) + defaultMessage + = SourceCodeInfo'Location{_SourceCodeInfo'Location'path = [], + _SourceCodeInfo'Location'span = [], + _SourceCodeInfo'Location'leadingComments = Prelude.Nothing, + _SourceCodeInfo'Location'trailingComments = Prelude.Nothing, + _SourceCodeInfo'Location'leadingDetachedComments = [], + _SourceCodeInfo'Location'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.name' @:: Lens' UninterpretedOption [UninterpretedOption'NamePart]@ @@ -4014,16 +3977,6 @@ instance Prelude.Functor f => (Lens.Family2.Unchecked.lens _UninterpretedOption'aggregateValue (\ x__ y__ -> x__{_UninterpretedOption'aggregateValue = y__})) Prelude.id -instance Data.Default.Class.Default UninterpretedOption where - def - = UninterpretedOption{_UninterpretedOption'name = [], - _UninterpretedOption'identifierValue = Prelude.Nothing, - _UninterpretedOption'positiveIntValue = Prelude.Nothing, - _UninterpretedOption'negativeIntValue = Prelude.Nothing, - _UninterpretedOption'doubleValue = Prelude.Nothing, - _UninterpretedOption'stringValue = Prelude.Nothing, - _UninterpretedOption'aggregateValue = Prelude.Nothing, - _UninterpretedOption'_unknownFields = ([])} instance Data.ProtoLens.Message UninterpretedOption where messageName _ = Data.Text.pack "google.protobuf.UninterpretedOption" @@ -4102,6 +4055,15 @@ instance Data.ProtoLens.Message UninterpretedOption where unknownFields = Lens.Family2.Unchecked.lens _UninterpretedOption'_unknownFields (\ x__ y__ -> x__{_UninterpretedOption'_unknownFields = y__}) + defaultMessage + = UninterpretedOption{_UninterpretedOption'name = [], + _UninterpretedOption'identifierValue = Prelude.Nothing, + _UninterpretedOption'positiveIntValue = Prelude.Nothing, + _UninterpretedOption'negativeIntValue = Prelude.Nothing, + _UninterpretedOption'doubleValue = Prelude.Nothing, + _UninterpretedOption'stringValue = Prelude.Nothing, + _UninterpretedOption'aggregateValue = Prelude.Nothing, + _UninterpretedOption'_unknownFields = ([])} {- | Fields : * 'Proto.Google.Protobuf.Descriptor_Fields.namePart' @:: Lens' UninterpretedOption'NamePart Data.Text.Text@ @@ -4143,14 +4105,6 @@ instance Prelude.Functor f => (\ x__ y__ -> x__{_UninterpretedOption'NamePart'isExtension = y__})) Prelude.id -instance Data.Default.Class.Default UninterpretedOption'NamePart - where - def - = UninterpretedOption'NamePart{_UninterpretedOption'NamePart'namePart - = Data.ProtoLens.fieldDefault, - _UninterpretedOption'NamePart'isExtension = - Data.ProtoLens.fieldDefault, - _UninterpretedOption'NamePart'_unknownFields = ([])} instance Data.ProtoLens.Message UninterpretedOption'NamePart where messageName _ = Data.Text.pack "google.protobuf.UninterpretedOption.NamePart" @@ -4179,4 +4133,10 @@ instance Data.ProtoLens.Message UninterpretedOption'NamePart where = Lens.Family2.Unchecked.lens _UninterpretedOption'NamePart'_unknownFields (\ x__ y__ -> - x__{_UninterpretedOption'NamePart'_unknownFields = y__}) \ No newline at end of file + x__{_UninterpretedOption'NamePart'_unknownFields = y__}) + defaultMessage + = UninterpretedOption'NamePart{_UninterpretedOption'NamePart'namePart + = Data.ProtoLens.fieldDefault, + _UninterpretedOption'NamePart'isExtension = + Data.ProtoLens.fieldDefault, + _UninterpretedOption'NamePart'_unknownFields = ([])} \ No newline at end of file diff --git a/proto-lens/src/Proto/Google/Protobuf/Descriptor_Fields.hs b/proto-lens/src/Proto/Google/Protobuf/Descriptor_Fields.hs index 70363ffa..05481b1d 100644 --- a/proto-lens/src/Proto/Google/Protobuf/Descriptor_Fields.hs +++ b/proto-lens/src/Proto/Google/Protobuf/Descriptor_Fields.hs @@ -14,7 +14,6 @@ import qualified Data.ProtoLens.Message.Enum import qualified Data.ProtoLens.Service.Types import qualified Lens.Family2 import qualified Lens.Family2.Unchecked -import qualified Data.Default.Class import qualified Data.Text import qualified Data.Map import qualified Data.ByteString