Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Any(iterable).isa-any(type) method #4631

Closed
wants to merge 1 commit into from
Closed

Conversation

lizmat
Copy link
Contributor

@lizmat lizmat commented Nov 9, 2021

This returns a boolean whether any values produced by the iterable match the given type. Intended to be used in e.g. constraints such as:

sub foo(@a where .isa-any(Int))

as an alternative to:

sub foo(@a where .any ~~ Int)

This is the logical counterpart of Any.isa-all from #4630

This returns a boolean whether *any* values produced by the iterable match
the given type. Intended to be used in e.g. constraints such as:

    sub foo(@A where .isa-any(Int))

as an alternative to:

    sub foo(@A where .any ~~ Int)

This is the logical counterpart of Any.isa-all.
@lizmat
Copy link
Contributor Author

lizmat commented Nov 9, 2021

Alternate name: any-is-type

@lizmat lizmat marked this pull request as draft November 10, 2021 17:44
@lizmat lizmat closed this Nov 17, 2021
@lizmat lizmat deleted the add-Any.isa-any branch November 17, 2021 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant