def heads

bend-ml-llama@0.2.1.0 · main.bend:235

import bend-ml-llama@0.2.1.0/main.bend as BendMlLlama
import Base

235# n heads of 2·half numbers from xs, in order
236def heads(n: Nat, +half: Nat, +xs: List<&2, F32>) -> List<&2, Head>:
237  match n:
238    case 0n:
239      Nil{}
240    case 1n+p:
241      split(half, List.take(&2, F32, xs, head(half))) <> heads(p, half, List.drop(&2, F32, xs, head(half)))

Uses (8)

Used by (2)