Add the deltaCopies to DSL. This in turn changed the api for chunk and relevant functions to go from (Card -> Card) to (Card -> Maybe Card) as the new number of copies can then be below 1 and that should be handled differently depending on the interpreter.
WRLD7PACYNQI2F3MAYAM5OK4RHO7CZ4OMYWAZ37UQY2IJ4AYS7LAC
oldCard {Deck.category = newCategory}
in Just $ oldCard {Deck.category = newCategory}
deltaCopies delta = return $ \oldCard ->
let oldCopies = fromIntegral . unrefine . runNumber . quantity $ oldCard
refinedCopies =
fmap PositiveNumber . eitherToMaybe . refine . fromIntegral $ oldCopies + delta
in fmap (\x -> oldCard {quantity = x}) refinedCopies
modifyCopies :: (PositiveNumber -> PositiveNumber) -> repr (Card -> Card)
modifyCategory :: (Category -> Category) -> repr (Card -> Card)
modifyCopies :: (PositiveNumber -> PositiveNumber) -> repr (Card -> Maybe Card)
modifyCategory :: (Category -> Category) -> repr (Card -> Maybe Card)
deltaCopies :: Int -> repr (Card -> Maybe Card)