B:BD[
2.305] → [
2.305:632]
B:BD[
3.801] → [
3.801:836]
| not $ partialEqCard quantity x y =
go
( ChangeQuantity
( (fromIntegral . unrefine . quantity $ y)
- (fromIntegral . unrefine . quantity $ x)
)
: acc
)
xs
ys
| otherwise = go acc xs ys
| otherwise =
let chQ = ChangeQuantity (name x) (runQuantity y - runQuantity x)
chC = ChangeCategory (name x) (category x) (category y)
in case (partialEqCard quantity x y, partialEqCard category x y) of
(True, True) -> go acc xs ys
(False, False) -> go (chQ : chC : acc) xs ys
(False, _) -> go (chQ : acc) xs ys
(_, False) -> go (chC : acc) xs ys
runQuantity = fromIntegral . unrefine . quantity