B:BD[
4.5259] → [
4.5259:5320]
B:BD[
4.5320] → [
2.58:109]
∅:D[
2.109] → [
4.5371:5515]
B:BD[
4.5371] → [
4.5371:5515]
B:BD[
4.5515] → [
5.239:582]
B:BD[
5.582] → [
2.110:308]
| name x < name y = go (remove (name x) : acc) xs ly
| name x > name y = go (add y : acc) lx ys
| otherwise =
case (partialEqCard quantity x y, partialEqCard category x y) of
(True, True) -> go acc xs ys
(False, False) ->
go
( chunk
(name x)
[modifyCopies (const $ quantity y), modifyCategory (const . category $ y)]
: acc
)
xs
ys
(False, _) -> go (chunk (name x) [modifyCopies (const $ quantity y)] : acc) xs ys
(_, False) -> go (chunk (name x) [modifyCategory (const $ category y)] : acc) xs ys
| x ^. name < y ^. name = go (Diff.delete (x ^. name) : acc) xs ly
| x ^. name > y ^. name = go (Diff.insert y : acc) lx ys
| otherwise = undefined -- Need a new algorithm here
-- case (partialEqCard quantity x y, partialEqCard category x y) of
-- (True, True) -> go acc xs ys
-- (False, False) ->
-- go
-- ( chunk
-- (name x)
-- [modifyCopies (const $ quantity y), modifyCategory (const . category $ y)]
-- : acc
-- )
-- xs
-- ys
-- (False, _) -> go (chunk (name x) [modifyCopies (const $ quantity y)] : acc) xs ys
-- (_, False) -> go (chunk (name x) [modifyCategory (const $ category y)] : acc) xs ys