@@ -267,6 +267,22 @@ instance Serialize (Array a) where
267267 Unbox.putSliceUnsafe arrContents arrStart arr off1 arrLen
268268 pure (off1 + arrLen)
269269
270+instance (Serialize a, Serialize b) => Serialize (a, b) where
271+
272+ {-# INLINE size #-}
273+ size acc (a, b) = size (size acc a) b
274+
275+ {-# INLINE serialize #-}
276+ serialize off arr (a, b) = do
277+ off1 <- serialize off arr a
278+ serialize off1 arr b
279+
280+ {-# INLINE deserialize #-}
281+ deserialize off arr end = do
282+ (off1, a) <- deserialize off arr end
283+ (off2, b) <- deserialize off1 arr end
284+ pure (off2, (a, b))
285+
270286--------------------------------------------------------------------------------
271287-- High level functions
272288--------------------------------------------------------------------------------