@@ -26,16 +26,22 @@ If our database has users and orders, these tables might both have ids, but they
2626are clearly not meant to be treated as a common type. Instead, we can make these
2727types clearly different by writing::
2828
29− newtype UserId = UserId Int64
29+ newtype UserId = UserId { getUserId :: Int64 }
3030 deriving newtype DBType
3131
32− newtype OrderId = OrderId Int64
32+ newtype OrderId = OrderId { getOrderId :: Int64 }
3333 deriving newtype DBType
3434
3535Now we can use ``UserId`` and ``OrderId`` in our Rel8 queries and definitions,
3636and Haskell will make sure we don't accidentally use an ``OrderId`` when we're
3737looking up a user.
3838
39+If you would like to use this approach but can't use generalized newtype
40+deriving, the same can be achived by using ``mapTypeInformation``::
41+
42+ instance DBType UserId where
43+ typeInformation = mapTypeInformation UserId getUserId typeInformation
44+
3945Parsing with ``DBType``
4046-----------------------
4147