musique/examples/common-array-operations.mq
2022-10-31 00:31:47 +01:00

6 lines
218 B
Plaintext

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