@@ -42,12 +42,12 @@ import Streamly.Benchmark.Data.Serialize.RecNonCompatible
4242
4343#ifdef USE_UNBOX
4444#define SERIALIZE_CLASS Unbox
45−#define DERIVE_CLASS deriveUnbox
45+#define DERIVE_CLASS(typ) $(deriveUnbox ''typ)
4646#define SERIALIZE_OP pokeByteIndex
4747#define DESERIALIZE_OP peekByteIndex
4848#else
4949#define SERIALIZE_CLASS Serialize
50−#define DERIVE_CLASS deriveSerialize
50+#define DERIVE_CLASS(typ) $(deriveSerialize [d|instance Serialize typ|])
5151#define SERIALIZE_OP serialize
5252#define DESERIALIZE_OP deserialize
5353#endif
@@ -62,7 +62,7 @@ data Unit = Unit
6262#ifndef USE_TH
6363instance SERIALIZE_CLASS Unit
6464#else
65−$(DERIVE_CLASS ''Unit)
65+DERIVE_CLASS(Unit)
6666#endif
6767
6868instance NFData Unit where
@@ -77,7 +77,7 @@ data Sum2
7777#ifndef USE_TH
7878instance SERIALIZE_CLASS Sum2
7979#else
80−$(DERIVE_CLASS ''Sum2)
80+DERIVE_CLASS(Sum2)
8181#endif
8282
8383instance NFData Sum2 where
@@ -115,7 +115,7 @@ data Sum25
115115#ifndef USE_TH
116116instance SERIALIZE_CLASS Sum25
117117#else
118−$(DERIVE_CLASS ''Sum25)
118+DERIVE_CLASS(Sum25)
119119#endif
120120
121121instance NFData Sum25 where
@@ -154,7 +154,7 @@ data Product25
154154#ifndef USE_TH
155155instance SERIALIZE_CLASS Product25
156156#else
157−$(DERIVE_CLASS ''Product25)
157+DERIVE_CLASS(Product25)
158158#endif
159159
160160instance NFData Product25 where
@@ -234,7 +234,7 @@ data CustomDT1
234234#ifndef USE_TH
235235instance SERIALIZE_CLASS CustomDT1
236236#else
237−$(DERIVE_CLASS ''CustomDT1)
237+DERIVE_CLASS(CustomDT1)
238238#endif
239239
240240instance NFData CustomDT1 where
@@ -257,7 +257,7 @@ data BinTree a
257257#ifndef USE_TH
258258instance Serialize (BinTree a)
259259#else
260−$(deriveSerialize ''BinTree)
260+$(deriveSerialize [d|instance Serialize a => Serialize (BinTree a)|])
261261#endif
262262
263263instance NFData a => NFData (BinTree a) where