enum.chunk
0.000000

Chunks enumerable values.

Arguments
procrequired
The proc to call with each enumerable value.
Return Value
An enumerator that chunks each enumerable value.
something went wrong :(
Chunking an array of numbers
Setup
authorization=PROCAUTH
require "proc"

client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.enum.chunk.call([0, 1, 2]) {
  client.type.number.positive
}
client.enum.chunk.call([0, 1, 2], () {
  return client.type.number.positive;
});
curl "https://proc.run/enum/chunk" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: application/vnd.proc+json" \
--header "accept: text/plain" \
--data '[[">>", ["%%", [0, 1, 2]]], ["$$", "proc", ["{}", ["()", "type.number.positive"]]]]'
 

[[false, [0]], [true, [1, 2]]]

enum.* procs can iterate over cursors in addition to arrays—learn more in the docs.


Stuck? Want to chat about an idea? Join the community on Discord.