Some feedback I received:
[...] possibly some type aliases / newtype wrappers would make the code more readable I think, take
data StreamFamily streamId eventId metadata event = StreamFamily
{ connectionPool :: forall a. (PG.Connection -> IO a) -> IO a
, relation :: PG.Query
, notificationChannel :: PG.Query
, parseNotification :: BS.ByteString -> Either String (streamId, eventId)
, streamIdentifierColumn :: PG.Query
, eventIdentifierColumn :: PG.Query
, metadataColumns :: [PG.Query]
, eventColumn :: PG.Query
}
all those PG.Query don't give much info, you need to look at the selector to understand their use (disclaimer: I like to look at type name more than anything else so I'm biased here). eventColumn maybe can be a bit clearer e.g. eventDataColumn / dataColumn or the likes?
Some feedback I received: