<commit_before>## miscellaneous operators can go here.
##   generic numeric operators are in Numeric.pm
##   generic string operators are in Stringy.pm
##   Int/Rat/Num operators are in {Int|Rat|Num}.pm

sub infix:<=>(Mu \$a, Mu \$b) is rw {
    pir::perl6_container_store__0PP($a, $b)
}

proto infix:<does>(|$) { * }
multi infix:<does>(Mu \$obj, Mu:U \$role) is rw {
    # XXX Mutability check.
    $obj.HOW.mixin($obj, $role);
}
multi infix:<does>(Mu \$obj, @roles) is rw {
    # XXX Mutability check.
    $obj.HOW.mixin($obj, |@roles);
}

proto infix:<but>(|$) { * }
multi infix:<but>(Mu \$obj, Mu:U \$role) {
    $obj.HOW.mixin($obj.clone(), $role);
}
multi infix:<but>(Mu \$obj, @roles) {
    $obj.HOW.mixin($obj.clone(), |@roles);
}

sub SEQUENCE($left, $right, :$exclude_end) {
    my @right := $right.flat;
    my $endpoint = @right.shift;
    my $infinite = $endpoint ~~ Whatever;
    $endpoint = Bool::False if $infinite;
    my $tail := ().list;

    my sub generate($code) {
        my $count = $code.count;
        my $value;
        while 1 {
            $tail.munch($tail.elems - $count);
            $value := $code(|$tail);
            last if $value ~~ $endpoint;
            $tail.push($value);
            take $value;
        }
        $value;
    }

    my sub succpred($cmp) {
        ($cmp < 0) ?? { $^x.succ } !! ( $cmp > 0 ?? { $^x.pred } !! { $^x } )
    }

    (GATHER({
        my @left := $left.flat;
        my $value;
        my $code;
        my $stop;
        while @left {
            $value = @left.shift;
            if $value ~~ Code { $code = $value; last }
            if $value ~~ $endpoint { $stop = 1; last }
            $tail.push($value);
            take $value;
        }
        unless $stop {
            $tail.munch($tail.elems - 3) if $tail.elems > 3;
            my $a = $tail[0];
            my $b = $tail[1];
            my $c = $tail[2];
            if $code.defined { }
            elsif $tail.elems == 3 {<commit_msg>Make n/1 Rats be Ints in sequence generation<commit_after>## miscellaneous operators can go here.
##   generic numeric operators are in Numeric.pm
##   generic string operators are in Stringy.pm
##   Int/Rat/Num operators are in {Int|Rat|Num}.pm

sub infix:<=>(Mu \$a, Mu \$b) is rw {
    pir::perl6_container_store__0PP($a, $b)
}

proto infix:<does>(|$) { * }
multi infix:<does>(Mu \$obj, Mu:U \$role) is rw {
    # XXX Mutability check.
    $obj.HOW.mixin($obj, $role);
}
multi infix:<does>(Mu \$obj, @roles) is rw {
    # XXX Mutability check.
    $obj.HOW.mixin($obj, |@roles);
}

proto infix:<but>(|$) { * }
multi infix:<but>(Mu \$obj, Mu:U \$role) {
    $obj.HOW.mixin($obj.clone(), $role);
}
multi infix:<but>(Mu \$obj, @roles) {
    $obj.HOW.mixin($obj.clone(), |@roles);
}

sub SEQUENCE($left, $right, :$exclude_end) {
    my @right := $right.flat;
    my $endpoint = @right.shift;
    my $infinite = $endpoint ~~ Whatever;
    $endpoint = Bool::False if $infinite;
    my $tail := ().list;

    my sub generate($code) {
        my $count = $code.count;
        my $value;
        while 1 {
            $tail.munch($tail.elems - $count);
            $value := $code(|$tail);
            last if $value ~~ $endpoint;
            if $value.isa(Rat) && $value.denominator == 1 {
                $value := $value.Int
            }
            $tail.push($value);
            take $value;
        }
        $value;
    }

    my sub succpred($cmp) {
        ($cmp < 0) ?? { $^x.succ } !! ( $cmp > 0 ?? { $^x.pred } !! { $^x } )
    }

    (GATHER({
        my @left := $left.flat;
        my $value;
        my $code;
        my $stop;
        while @left {
            $value = @left.shift;
            if $value ~~ Code { $code = $value; last }
            if $value ~~ $endpoint { $stop = 1; last }
            $tail.push($value);
            take $value;
        }
        unless $stop {
            $tail.munch($tail.elems - 3) if $tail.elems > 3;
            my $a = $tail[0];
            my $b = $tail[1];
            my $c = $tail[2];
            if $code.defined { }
            elsif $tail.elems == 3 {
{'fraction_non_alphanumeric': 0.18386308068459659, 'fraction_numerical': 0.006356968215158924, 'mean_word_length': 1.9158945117605133, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5142169', 'n_tokens_mistral': 1507, 'n_tokens_neox': 1449, 'n_words': 363}