@@ -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 =
68− { unconstrained :: [String]
69− -- ^ Type variables that should not have the 'Serialize' constraint.
72− -- data CustomDataType a b c d = CustomDataType a c
76− -- conf = defaultConf {unconstrained = ["b", "d"]}
77− -- \$(deriveSerializeWith conf ''CustomDataType)
81− -- instance (Serialize a, Serialize c) => Serialize (CustomDataType a b c d) where
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.
90− -- data CustomDataType f a = CustomDataType (f a)
94− -- conf = defaultConf {specializations = [("f", ''Identity)]}
95− -- \$(deriveSerializeWith conf ''CustomDataType)
99− -- instance (Serialize a) => Serialize (CustomDataType Identity a) where
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 =
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