Samstag, 2. Juni 2018 18:00If we have an algorithm that only needs a Bag, then we are free to improve the implementation of Bag in the future so that it doesn’t preserve order under the hood (e.g, use a hash table). So, I personally think it’s useful to have around.
Sent from my phone.Samstag, 2. Juni 2018 12:13We have OrdList which does:
Provide trees (of instructions), so that lists of instructions
can be appended in linear time.
And Bag which claims to be:
an unordered collection with duplicates
However the actual implementation of Bag is also a tree if things.
Given that we have snocBag, consBag that implies to me it's
also an ordered collection.
I wondered if besides of someone having to do it if there is a reason why these couldn't be combined
into a single data structure? Their implementation seems similar enough as far as I can tell.