on master help sign in
Remove unconstained and specializations from Serialize.TH.Config
31aeb36Adithya Kumar
core/src/Streamly/Internal/Data/Serialize/TH/Bottom.hs+2−40
@@ -65,43 +65,7 @@ import Streamly.Internal.Data.Unbox.TH (DataCon(..))
65-- | Config to control how the 'Serialize' instance is generated.
65-- | Config to control how the 'Serialize' instance is generated.
66data Config =
66data Config =
67 Config
67 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
105 -- ^ Inline value for 'size'. Default is Inline.
69 -- ^ Inline value for 'size'. Default is Inline.
106 , inlineSerialize :: Inline
70 , inlineSerialize :: Inline
107 -- ^ Inline value for 'serialize'. Default is Inline.
71 -- ^ Inline value for 'serialize'. Default is Inline.
@@ -122,9 +86,7 @@ data Config =
122defaultConfig :: Config
86defaultConfig :: Config
123defaultConfig =
87defaultConfig =
124 Config
88 Config
125− { unconstrained = []
126− , specializations = []
127− , inlineSize = Inline
89+ { inlineSize = Inline
128 , inlineSerialize = Inline
90 , inlineSerialize = Inline
129 , inlineDeserialize = Inline
91 , inlineDeserialize = Inline
130 , constructorTagAsString = False
92 , constructorTagAsString = False