existsReviewAssignment :: ReviewAssignment -> IO Bool
existsReviewAssignment x = databaseProviderReviews $ do
        existing <- selectList
            [ReviewAssignmentAssignment ==. reviewAssignmentAssignment x,
            ReviewAssignmentReviewer ==. reviewAssignmentReviewer x,
            ReviewAssignmentReviewee ==. reviewAssignmentReviewee x,
            ReviewAssignmentRole ==. reviewAssignmentRole x] []
        return $ not $ null existing

-- | Retrieves all ReviewAssignments for an Assignment from
-- | a database or file system.
existsReviewAssignment :: ReviewAssignment -> IO Bool
existsReviewAssignment x = databaseProviderReviews $ do
        existing <- selectList
            [ReviewAssignmentAssignment ==. reviewAssignmentAssignment x,
            ReviewAssignmentReviewer ==. reviewAssignmentReviewer x,
            ReviewAssignmentReviewee ==. reviewAssignmentReviewee x,
            ReviewAssignmentRole ==. reviewAssignmentRole x] []
        return $ not $ null existing

-- | Retrieves all ReviewAssignments for an Assignment from
-- | a database or file system.
existsReviewAssignment x = databaseProviderReviews $ do
        existing <- selectList
            [ReviewAssignmentAssignment ==. reviewAssignmentAssignment x,
            ReviewAssignmentReviewer ==. reviewAssignmentReviewer x,
            ReviewAssignmentReviewee ==. reviewAssignmentReviewee x,
            ReviewAssignmentRole ==. reviewAssignmentRole x] []
        return $ not $ null existing

-- | Retrieves all ReviewAssignments for an Assignment from
-- | a database or file system.