wdl
wdl copied to clipboard
Add array `contains` function
Checklist
- [x] Pull request details were added to CHANGELOG.md
- [x] Valid examples WDL's were added or updated to the SPEC.md (see the guide on writing markdown tests)
@jdidion do we need to make any comments here on how equality works and whether type coerced objects are equal?
Ie would the following be truthy?
File Foo = "foo"
Array[String] bar = ["foo"]
@patmagee yes type coercion should apply here. String
-> File
is one of the officially supported coercions, but not File
-> String
.
Array[File] files = ["/foo/bar"]
contains(files, "/foo/bar") # true
Array[String] strings = ["/foo/bar"]
File foobar = "/foo/bar"
contains(strings, foobar) # false
contains(strings, "~{foobar}") # true