Skip to content

Commit

Permalink
Make sure all set ops have an "is pure" on their proto only
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Feb 27, 2018
1 parent 52176c3 commit af35389
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 31 deletions.
16 changes: 8 additions & 8 deletions src/core/set_elem.pm
Expand Up @@ -73,18 +73,18 @@ multi sub infix:<(elem)>(Any $a, Any $b) { infix:<(elem)>($a,$b.Set) }
my constant &infix:<∈> := &infix:<(elem)>;

# U+2209 NOT AN ELEMENT OF
proto sub infix:<βˆ‰>(|) {*}
multi sub infix:<βˆ‰>($a, $b --> Bool:D) is pure { not $a (elem) $b }
proto sub infix:<βˆ‰>(|) is pure {*}
multi sub infix:<βˆ‰>($a, $b --> Bool:D) { not $a (elem) $b }

proto sub infix:<(cont)>(|) {*}
multi sub infix:<(cont)>($a, $b --> Bool:D) is pure { $b (elem) $a }
proto sub infix:<(cont)>(|) is pure {*}
multi sub infix:<(cont)>($a, $b --> Bool:D) { $b (elem) $a }

# U+220B CONTAINS AS MEMBER
proto sub infix:<βˆ‹>(|) {*}
multi sub infix:<βˆ‹>($a, $b --> Bool:D) is pure { $b (elem) $a }
proto sub infix:<βˆ‹>(|) is pure {*}
multi sub infix:<βˆ‹>($a, $b --> Bool:D) { $b (elem) $a }

# U+220C DOES NOT CONTAIN AS MEMBER
proto sub infix:<∌>(|) {*}
multi sub infix:<∌>($a, $b --> Bool:D) is pure { not $b (elem) $a }
proto sub infix:<∌>(|) is pure {*}
multi sub infix:<∌>($a, $b --> Bool:D) { not $b (elem) $a }

# vim: ft=perl6 expandtab sw=4
12 changes: 6 additions & 6 deletions src/core/set_precedes.pm
Expand Up @@ -107,24 +107,24 @@ multi sub infix:<<(<+)>>(Any $a, Any $b --> Bool:D) {
}

# U+227C PRECEDES OR EQUAL TO
proto sub infix:<β‰Ό>(|) {*}
multi sub infix:<β‰Ό>($a, $b --> Bool:D) is pure {
proto sub infix:<β‰Ό>(|) is pure {*}
multi sub infix:<β‰Ό>($a, $b --> Bool:D) {
my $*WHAT = "β‰Ό";
my $*INSTEAD = "βŠ†";
infix:<<(<+)>>($a, $b)
}

# $a (>+) $b === $a R(<+) $b
proto sub infix:<<(>+)>>(|) {*}
multi sub infix:<<(>+)>>($a, $b --> Bool:D) is pure {
proto sub infix:<<(>+)>>(|) is pure {*}
multi sub infix:<<(>+)>>($a, $b --> Bool:D) {
my $*WHAT = "(>+)";
my $*INSTEAD = "(>=)";
infix:<<(<+)>>($b, $a)
}

# U+227D SUCCEEDS OR EQUAL TO
proto sub infix:<≽>(|) {*}
multi sub infix:<≽>($a, $b --> Bool:D) is pure {
proto sub infix:<≽>(|) is pure {*}
multi sub infix:<≽>($a, $b --> Bool:D) {
my $*WHAT = "≽";
my $*INSTEAD = "βŠ‡";
infix:<<(<+)>>($b, $a)
Expand Down
16 changes: 8 additions & 8 deletions src/core/set_proper_subset.pm
Expand Up @@ -115,18 +115,18 @@ multi sub infix:<<(<)>>(Any $a, Any $b --> Bool:D) {
my constant &infix:<βŠ‚> := &infix:<<(<)>>;

# U+2284 NOT A SUBSET OF
proto sub infix:<βŠ„>(|) {*}
multi sub infix:<βŠ„>($a, $b --> Bool:D) is pure { not $a (<) $b }
proto sub infix:<βŠ„>(|) is pure {*}
multi sub infix:<βŠ„>($a, $b --> Bool:D) { not $a (<) $b }

proto sub infix:<<(>)>>(|) {*}
multi sub infix:<<(>)>>(Any $a, Any $b --> Bool:D) is pure { $b (<) $a }
proto sub infix:<<(>)>>(|) is pure {*}
multi sub infix:<<(>)>>(Any $a, Any $b --> Bool:D) { $b (<) $a }

# U+2283 SUPERSET OF
proto sub infix:<βŠƒ>(|) {*}
multi sub infix:<βŠƒ>($a, $b --> Bool:D) is pure { $b (<) $a }
proto sub infix:<βŠƒ>(|) is pure {*}
multi sub infix:<βŠƒ>($a, $b --> Bool:D) { $b (<) $a }

# U+2285 NOT A SUPERSET OF
proto sub infix:<βŠ…>(|) {*}
multi sub infix:<βŠ…>($a, $b --> Bool:D) is pure { not $b (<) $a }
proto sub infix:<βŠ…>(|) is pure {*}
multi sub infix:<βŠ…>($a, $b --> Bool:D) { not $b (<) $a }

# vim: ft=perl6 expandtab sw=4
16 changes: 8 additions & 8 deletions src/core/set_subset.pm
Expand Up @@ -144,18 +144,18 @@ multi sub infix:<<(<=)>>(Any $a, Any $b --> Bool:D) {
my constant &infix:<βŠ†> := &infix:<<(<=)>>;

# U+2288 NEITHER A SUBSET OF NOR EQUAL TO
proto sub infix:<⊈>(|) {*}
multi sub infix:<⊈>($a, $b --> Bool:D) is pure { not $a (<=) $b }
proto sub infix:<⊈>(|) is pure {*}
multi sub infix:<⊈>($a, $b --> Bool:D) { not $a (<=) $b }

proto sub infix:<<(>=)>>(|) {*}
multi sub infix:<<(>=)>>(Any $a, Any $b --> Bool:D) is pure { $b (<=) $a }
proto sub infix:<<(>=)>>(|) is pure {*}
multi sub infix:<<(>=)>>(Any $a, Any $b --> Bool:D) { $b (<=) $a }

# U+2287 SUPERSET OF OR EQUAL TO
proto sub infix:<βŠ‡>(|) {*}
multi sub infix:<βŠ‡>($a, $b --> Bool:D) is pure { $b (<=) $a }
proto sub infix:<βŠ‡>(|) is pure {*}
multi sub infix:<βŠ‡>($a, $b --> Bool:D) { $b (<=) $a }

# U+2289 NEITHER A SUPERSET OF NOR EQUAL TO
proto sub infix:<βŠ‰>(|) {*}
multi sub infix:<βŠ‰>($a, $b --> Bool:D) is pure { not $b (<=) $a }
proto sub infix:<βŠ‰>(|) is pure {*}
multi sub infix:<βŠ‰>($a, $b --> Bool:D) { not $b (<=) $a }

# vim: ft=perl6 expandtab sw=4
2 changes: 1 addition & 1 deletion src/core/set_symmetric_difference.pm
Expand Up @@ -224,7 +224,7 @@ multi sub infix:<(^)>(Any $a, Any $b) {
)
}

multi sub infix:<(^)>(**@p) is pure {
multi sub infix:<(^)>(**@p) {

# positions / size in minmax info
my constant COUNT = 0;
Expand Down

0 comments on commit af35389

Please sign in to comment.