wdl
wdl copied to clipboard
A contains style function for Array
This WDL forum post presents a use-case for why a contains style function on arrays could be very useful. It also reflects on the downsides of current workarounds in WDL.
It would be helpful to have a function called "contains" or "exists" which returns a Boolean depending on whether a given value exists/is contained within a given array.
Draft implementation: https://github.com/openwdl/wdl/tree/117-contains
Restricting the allowed arguments to primitive types would help to avoid costly searches of nested collections.
Proposed signatures:
Boolean contains(Array[P], P)
Boolean contains(Array[P?], (P | None))
@patmagee grabbing this one from you