wdl icon indicating copy to clipboard operation
wdl copied to clipboard

A contains style function for Array

Open ruchim opened this issue 8 years ago • 2 comments

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

ruchim avatar Jun 19 '17 18:06 ruchim

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))

jdidion avatar Mar 23 '23 14:03 jdidion

@patmagee grabbing this one from you

jdidion avatar Apr 08 '24 23:04 jdidion