@@ -230,20 +230,26 @@ unpin arr@(MutableByteArray marr#) =
231-- | A type implementing the 'Unbox' interface supplies operations for reading
231-- | A type implementing the 'Unbox' interface supplies operations for reading
232-- and writing the type from and to a mutable byte array (an unboxed
232-- and writing the type from and to a mutable byte array (an unboxed
233−-- representation) in memory. The read operation 'peekByteIndex' constructs the
233+-- representation of the type) in memory. The read operation 'peekByteIndex'
234−-- boxed type from the mutable byte array. The write operation 'pokeByteIndex'
234+-- deserializes the boxed type from the mutable byte array. The write operation
235−-- writes the boxed type to the mutable byte array.
235+-- 'pokeByteIndex' serializes the boxed type to the mutable byte array.
237−-- Here is an example, to write an instance for this type class.
237+-- Instances can be derived via 'Generic'. Here is an example, for deriving an
238+-- instance of this type class.
240+-- >>> import GHC.Generics (Generic)
240-- data Object = Object
242-- data Object = Object
241-- { _int0 :: Int
243-- { _int0 :: Int
242-- , _int1 :: Int
244-- , _int1 :: Int
243−-- }
245+-- } deriving Generic
246-- >>> import Streamly.Data.Array (Unbox(..))
248-- >>> import Streamly.Data.Array (Unbox(..))
249+-- >>> instance Unbox Object
251+-- If you want to write the instance manually:
247-- >>> import Streamly.Internal.Data.Unboxed (castContents)
253-- >>> import Streamly.Internal.Data.Unboxed (castContents)
249-- instance Unbox Object where
255-- instance Unbox Object where