Skip to content

Commit

Permalink
Make all non-texas set operators aliases where possible
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Jul 13, 2017
1 parent b1c412a commit f6025eb
Show file tree
Hide file tree
Showing 8 changed files with 13 additions and 24 deletions.
5 changes: 2 additions & 3 deletions src/core/set_addition.pm
Expand Up @@ -157,9 +157,8 @@ multi sub infix:<(+)>(**@p) is pure {
$baghash.Bag(:view);
}
}

# U+228E MULTISET UNION
only sub infix:<>(|p) is pure {
infix:<(+)>(|p);
}
my constant &infix:<> := &infix:<(+)>;

# vim: ft=perl6 expandtab sw=4
4 changes: 1 addition & 3 deletions src/core/set_difference.pm
Expand Up @@ -128,8 +128,6 @@ multi sub infix:<(-)>(**@p) {
}

# U+2216 SET MINUS
only sub infix:<>(|p) is pure {
infix:<(-)>(|p);
}
my constant &infix:<> := &infix:<(-)>;

# vim: ft=perl6 expandtab sw=4
6 changes: 3 additions & 3 deletions src/core/set_elem.pm
Expand Up @@ -67,10 +67,10 @@ multi sub infix:<(elem)>(Any $a, QuantHash:D $b --> Bool:D) {
multi sub infix:<(elem)>(Any $a, Any $b --> Bool:D) {
$a (elem) $b.Set(:view);
}

# U+2208 ELEMENT OF
only sub infix:<>($a, $b --> Bool:D) is pure {
$a (elem) $b;
}
my constant &infix:<> := &infix:<(elem)>;

# U+2209 NOT AN ELEMENT OF
only sub infix:<>($a, $b --> Bool:D) is pure {
not $a (elem) $b;
Expand Down
4 changes: 1 addition & 3 deletions src/core/set_intersection.pm
Expand Up @@ -171,8 +171,6 @@ multi sub infix:<(&)>(**@p) {
}
}
# U+2229 INTERSECTION
only sub infix:<>(|p) is pure {
infix:<(&)>(|p);
}
my constant &infix:<> := &infix:<(&)>;

# vim: ft=perl6 expandtab sw=4
4 changes: 1 addition & 3 deletions src/core/set_multiply.pm
Expand Up @@ -74,8 +74,6 @@ multi sub infix:<(.)>(**@p) is pure {
}
}
# U+228D MULTISET MULTIPLICATION
only sub infix:<>(|p) is pure {
infix:<(.)>(|p);
}
my constant &infix:<> := &infix:<(.)>;

# vim: ft=perl6 expandtab sw=4
5 changes: 2 additions & 3 deletions src/core/set_proper_subset.pm
Expand Up @@ -116,9 +116,8 @@ multi sub infix:<<(<)>>(Failure $a, Any $b) { $a.throw }
multi sub infix:<<(<)>>(Any $a, Failure $b) { $b.throw }

# U+2282 SUBSET OF
only sub infix:<>($a, $b --> Bool:D) is pure {
$a (<) $b;
}
my constant &infix:<> := &infix:<<(<)>>;

# U+2284 NOT A SUBSET OF
only sub infix:<>($a, $b --> Bool:D) is pure {
not $a (<) $b;
Expand Down
5 changes: 2 additions & 3 deletions src/core/set_subset.pm
Expand Up @@ -139,9 +139,8 @@ multi sub infix:<<(<=)>>(Failure $a, Any $b) { $a.throw }
multi sub infix:<<(<=)>>(Any $a, Failure $b) { $b.throw }

# U+2286 SUBSET OF OR EQUAL TO
only sub infix:<>($a, $b --> Bool:D) is pure {
$a (<=) $b;
}
my constant &infix:<> := &infix:<<(<=)>>;

# U+2288 NEITHER A SUBSET OF NOR EQUAL TO
only sub infix:<>($a, $b --> Bool:D) is pure {
not $a (<=) $b;
Expand Down
4 changes: 1 addition & 3 deletions src/core/set_union.pm
Expand Up @@ -169,8 +169,6 @@ multi sub infix:<(|)>(**@p) {
}
}
# U+222A UNION
only sub infix:<>(|p) is pure {
infix:<(|)>(|p);
}
my constant &infix:<> := &infix:<(|)>;

# vim: ft=perl6 expandtab sw=4

0 comments on commit f6025eb

Please sign in to comment.