<html><head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head><body bgcolor="#FFFFFF" text="#000000">> we are free to 
improve the implementation of Bag in the future so that it doesn’t 
preserve order<br>
<br>
Imo we lost that ability by exposing consBag & snocBag which imply 
that there is a front and a back.<br>
Which at first glance also seem to be already used in GHC with that 
behavior in mind.<br>
<br>
I agree with the thought that not guaranteeing an ordering might have 
benefits.<br>
But in practice they are almost the same data structure with slightly 
different interfaces.<br>
<blockquote style="border: 0px none;" 
cite="mid:E5BE012B-82EC-475A-9B61-B49A8C242DB1@farvard.in" type="cite">
  <div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div 
style="width:100%;border-top:1px solid #EDEEF0;padding-top:5px">   <div 
style="display:inline-block;white-space:nowrap;vertical-align:middle;width:49%;">
        <a moz-do-not-send="true" href="mailto:kavon@farvard.in" 
style="color:#737F92 
!important;padding-right:6px;font-weight:bold;text-decoration:none 
!important;">Kavon Farvardin</a></div>   <div 
style="display:inline-block;white-space:nowrap;vertical-align:middle;width:48%;text-align:
 right;">     <font color="#9FA2A5"><span style="padding-left:6px">Samstag,
 2. Juni 2018 18:00</span></font></div>    </div></div>
  <div style="color:#888888;margin-left:24px;margin-right:24px;" 
__pbrmquotes="true" class="__pbConvBody"><div>If 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.<br><br>Sent from my phone.<br><br></div><div><!----><br></div></div>
  <div style="margin:30px 25px 10px 25px;" class="__pbConvHr"><div 
style="width:100%;border-top:1px solid #EDEEF0;padding-top:5px">   <div 
style="display:inline-block;white-space:nowrap;vertical-align:middle;width:49%;">
        <a moz-do-not-send="true" href="mailto:klebinger.andreas@gmx.at" 
style="color:#737F92 
!important;padding-right:6px;font-weight:bold;text-decoration:none 
!important;">Andreas Klebinger</a></div>   <div 
style="display:inline-block;white-space:nowrap;vertical-align:middle;width:48%;text-align:
 right;">     <font color="#9FA2A5"><span style="padding-left:6px">Samstag,
 2. Juni 2018 12:13</span></font></div>    </div></div>
  <div style="color:#888888;margin-left:24px;margin-right:24px;" 
__pbrmquotes="true" class="__pbConvBody">
<meta content="text/html; charset=UTF-8" http-equiv="content-type">
We have OrdList which does:<br>
  <br>
  <span style="font-family: monospace;">Provide trees (of instructions),
 so that lists of instructions</span><br style="font-family: monospace;">
  <span style="font-family: monospace;">can be appended in linear time.</span><br>
  <br>
And Bag which claims to be:<br>
  <br>
  <span style="font-family: monospace;">an unordered collection with 
duplicates<br>
    <br>
However the actual implementation of Bag is also a tree if things.<br>
Given that we have snocBag, consBag that implies to me it's<br>
also an ordered collection.<br>
    <br>
I wondered if besides of someone having to do it if there is a reason 
why these couldn't be combined<br>
into a single data structure? Their implementation seems similar enough 
as far as I can tell.<br>
  </span>
  </div>
</blockquote>
<br>
</body></html>