musique/examples/common-array-operations.mq

6 lines
218 B
Plaintext
Raw Permalink Normal View History

map := (fn array | result := (), for array (v | result = result & (| fn v) ), result),
drop := (n arr | arr[range n (len arr)]),
take := (n arr | arr[up n]),
filter := (predicate arr | arr[map predicate arr]),