[hail] Add two new forms to any all#9835
Merged
danking merged 8 commits intohail-is:mainfrom Dec 22, 2020
Merged
Conversation
CHANGELOG: `hl.any` and `hl.all` now also support a single collection argument and a varargs of Boolean expressions
Any and all currently take two arguments: a function and a collection. This
differs from the Python `any` and `all` which take only a collection and check
for truthy values.
We rectify this situation by supporting three forms:
1. ``hl.all(boolean, ...)``, are all arguments ``True``?
2. ``hl.all(collection)``, are all elements of the collection ``True``?
3. ``hl.all(function, collection)``, does ``function`` return ``True`` for
all values in this collection?
Contributor
Author
tpoterba
approved these changes
Dec 21, 2020
Contributor
tpoterba
left a comment
There was a problem hiding this comment.
good change, especially the checker refactor!
added 2 commits
December 21, 2020 19:38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

CHANGELOG:
hl.anyandhl.allnow also support a single collection argument and a varargs of Boolean expressionsAny and all currently take two arguments: a function and a collection. This
differs from the Python
anyandallwhich take only a collection and checkfor truthy values.
We rectify this situation by supporting three forms:
hl.all(boolean, ...), are all argumentsTrue?hl.all(collection), are all elements of the collectionTrue?hl.all(function, collection), doesfunctionreturnTrueforall values in this collection?