XQBYALGEDBGQIHMEI4FFDGMQCMOPE4SJLBDROYF5YVMU7H5IKV6AC modifyCopies = undefinedmodifyCategory = undefined
move old new = R $ \card ->let removeOld x = x & categories %~ Map.delete (toText old)oldCopies = card ^? categories . ix (toText old) . copiesupdateCopies x =Map.alter( \caseNothing -> Just $ Category new xJust oldCategory -> Just $ oldCategory & copies %~ uncheckedAdd x)(toText new)(card ^. categories)in oldCopies <&> removeOld . (\x -> card & categories .~ updateCopies x)
card ^. categories . at categoryName<&> toNumber @Int<&> (+ delta)update x = card & (categories . ix (toText category)) .~ x
card ^? categories . ix (toText category) . copies<&> (+ delta) . toNumber @Intupdate x = card & (categories . ix (toText category) . copies) .~ x