(module unordered-bag mzscheme
(require "../private/require.ss")
(require-contracts)
(require-class)
(require-lists)
(require "../table/unordered-table.ss"
"bag-interface.ss"
"bag-from-table.ss")
(provide/contract
[unordered-bag% (implementation?/c bag<%>)]
[make-unordered-bag (([equ? equality/c]
[elems (listof any/c)])
. ->r . bag/c)])
(define (make-unordered-bag equ? elems)
(foldl (lambda (elem bag)
(send bag insert elem))
(make-bag-from-table (make-unordered-table equ? null null))
elems))
(define unordered-bag% bag-from-table%)
)