@@ -65,43 +65,7 @@ import Streamly.Internal.Data.Unbox.TH (DataCon(..))
6565-- | Config to control how the 'Serialize' instance is generated.
6666data Config =
6767 Config
68− { unconstrained :: [String]
69− -- ^ Type variables that should not have the 'Serialize' constraint.
70− --
71− -- @
72− -- data CustomDataType a b c d = CustomDataType a c
73− -- @
74− --
75− -- @
76− -- conf = defaultConf {unconstrained = ["b", "d"]}
77− -- \$(deriveSerializeWith conf ''CustomDataType)
78− -- @
79− --
80− -- @
81− -- instance (Serialize a, Serialize c) => Serialize (CustomDataType a b c d) where
82− -- ...
83− -- @
84− , specializations :: [(String, Type)]
85− -- ^ Specialize the type variable with the given type. All type
86− -- variables listed here will not have the 'Serialize' constriant as
87− -- they are specialized.
88− --
89− -- @
90− -- data CustomDataType f a = CustomDataType (f a)
91− -- @
92− --
93− -- @
94− -- conf = defaultConf {specializations = [("f", ''Identity)]}
95− -- \$(deriveSerializeWith conf ''CustomDataType)
96− -- @
97− --
98− -- @
99− -- instance (Serialize a) => Serialize (CustomDataType Identity a) where
100− -- ...
101− -- @
102− --
103− -- @f@ is replaced with 'Identity' and becomes unconstrained.
104− , inlineSize :: Inline
68+ { inlineSize :: Inline
10569 -- ^ Inline value for 'size'. Default is Inline.
10670 , inlineSerialize :: Inline
10771 -- ^ Inline value for 'serialize'. Default is Inline.
@@ -122,9 +86,7 @@ data Config =
12286defaultConfig :: Config
12387defaultConfig =
12488 Config
125− { unconstrained = []
126− , specializations = []
127− , inlineSize = Inline
89+ { inlineSize = Inline
12890 , inlineSerialize = Inline
12991 , inlineDeserialize = Inline
13092 , constructorTagAsString = False