itemsRelatedVal
    :: forall err schema.
       (schema -> Value -> [err])
    -> ItemsRelated schema
    -> Vector Value
    -> [ItemsRelatedInvalid err] -- NOTE: 'Data.These' would help here.
itemsRelatedVal f a xs =
    let (itemsFailure, remaining) = case _irItems a of
                                        Nothing -> (Nothing, mempty)
                                        Just b  -> itemsVal f b xs
        additionalFailure = (\b -> additionalItemsVal f b remaining)
                        =<< _irAdditional a
    in catMaybes [ IRInvalidItems <$> itemsFailure
                 , IRInvalidAdditional <$> additionalFailure
                 ]
itemsRelatedVal
    :: forall err schema.
       (schema -> Value -> [err])
    -> ItemsRelated schema
    -> Vector Value
    -> [ItemsRelatedInvalid err]
itemsRelatedVal f a xs =
    let (itemsFailure, remaining) = case _irItems a of
                                        Nothing -> (Nothing, mempty)
                                        Just b  -> itemsVal f b xs
        additionalFailure = (\b -> additionalItemsVal f b remaining)
                        =<< _irAdditional a
    in catMaybes [ IRInvalidItems <$> itemsFailure
                 , IRInvalidAdditional <$> additionalFailure
                 ]
itemsRelatedVal f a xs =
    let (itemsFailure, remaining) = case _irItems a of
                                        Nothing -> (Nothing, mempty)
                                        Just b  -> itemsVal f b xs
        additionalFailure = (\b -> additionalItemsVal f b remaining)
                        =<< _irAdditional a
    in catMaybes [ IRInvalidItems <$> itemsFailure
                 , IRInvalidAdditional <$> additionalFailure
                 ]