You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The built-in list type represents an ordered collection with duplicates allowed; in this change, we add a bag type that also allows duplicates but has no guaranteed order. (See discussion #232.)
This means that, given a bag and a list with the same N elements, the list contains more information, because it has remembered which of the N! orderings of the elements has occurred. Converting from a list to a bag is therefore lossy. But there is a bijection between 'a list and ('a * int) bag provided that the int ordinals are unique.
The Bag structure has analogous operations to the standard List structure, except for nth, take, drop, rev.
We add mapi to List (based on Vector.mapi).
The text was updated successfully, but these errors were encountered:
…dered collections with duplicates allowed
The built-in `list` type represents an ordered collection with duplicates allowed; in this change, we add a `bag` type that also allows duplicates but has no guaranteed order.
This means that, given a bag and a list with the same N elements, the list contains more information, because it has remembered which of the N! orderings of the elements has occurred. Converting from a list to a bag is therefore lossy. But there is a bijection between 'a list and ('a * int) bag provided that the int ordinals are unique.
The Bag structure has analogous operations to the standard List structure, except for nth, take, drop, rev.
We add mapi to List (based on Vector.mapi).
Fixeshydromatic#235
…dered collections with duplicates allowed
The built-in `list` type represents an ordered collection with duplicates allowed; in this change, we add a `bag` type that also allows duplicates but has no guaranteed order.
This means that, given a bag and a list with the same N elements, the list contains more information, because it has remembered which of the N! orderings of the elements has occurred. Converting from a list to a bag is therefore lossy. But there is a bijection between 'a list and ('a * int) bag provided that the int ordinals are unique.
The Bag structure has analogous operations to the standard List structure, except for nth, take, drop, rev.
We add mapi to List (based on Vector.mapi).
Fixeshydromatic#235
The built-in
list
type represents an ordered collection with duplicates allowed; in this change, we add abag
type that also allows duplicates but has no guaranteed order. (See discussion #232.)This means that, given a
bag
and alist
with the same N elements, thelist
contains more information, because it has remembered which of the N! orderings of the elements has occurred. Converting from alist
to abag
is therefore lossy. But there is a bijection between'a list
and('a * int) bag
provided that theint
ordinals are unique.The
Bag
structure has analogous operations to the standardList
structure, except fornth
,take
,drop
,rev
.We add
mapi
toList
(based onVector.mapi
).The text was updated successfully, but these errors were encountered: