Skip to content

Commit

Permalink
Dial back msubset and msuperset to only work on Baggy objects.
Browse files Browse the repository at this point in the history
  • Loading branch information
colomon committed Jun 7, 2012
1 parent 556574c commit e52d6c3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/CORE.setting
Original file line number Diff line number Diff line change
Expand Up @@ -2256,12 +2256,10 @@ multi sub infix:<⊎>(Bag $a, Bag $b --> Bag) { bag((set($a) ∪ set($b)).map({
only sub infix:<(+)>($a, $b --> Bag) is equiv(&infix:<X>) { $a $b }
proto sub infix:<≼>($, $ --> Bool) is equiv(&infix:<==>) {*}
multi sub infix:<≼>(Any $a, Any $b --> Bool) { bag($a) bag($b) }
multi sub infix:<≼>(Bag $a, Bag $b --> Bool) { so all $a.keys.map({ $a{$_} <= $b{$_} }) }
multi sub infix:<≼>(Baggy $a, Baggy $b --> Bool) { so all $a.keys.map({ $a{$_} <= $b{$_} }) }
proto sub infix:<≽>($, $ --> Bool) is equiv(&infix:<==>) {*}
multi sub infix:<≽>(Any $a, Any $b --> Bool) { bag($a) bag($b) }
multi sub infix:<≽>(Bag $a, Bag $b --> Bool) { so all $b.keys.map({ $b{$_} <= $a{$_} }) }
multi sub infix:<≽>(Baggy $a, Baggy $b --> Bool) { so all $b.keys.map({ $b{$_} <= $a{$_} }) }
class KeyBag does Associative does Baggy {
has Int %!elems; # should be UInt
Expand Down

0 comments on commit e52d6c3

Please sign in to comment.