I have a list of instances of a structure called "contact", which is basically a phone number and the duration a call with them took.
I now want to add together all entries of the same phone number with the total duration of all calls with them.
E.g: i want to turn:
(list
(make-contact "0111222222" 2)
(make-contact "0111222222" 6)
(make-contact "0111333333" 5)
(make-contact "0111444444" 3)
(make-contact "0111555555" 8)
(make-contact "0111555555" 2))
into:
(list
(make-contact "0111222222" 8)
(make-contact "0111333333" 5)
(make-contact "0111444444" 3)
(make-contact "0111555555" 10))
Im using Racket BSL with List abbreviations