✨ ARCANUM RUNE DIFFICULTY: Archmage Structural

The Composite: Segmented Scan Sorcery

Treat massive nested data structures identically through segmented operations.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Composite
ARCANUM SCHOOL: Abjuration // Geometry
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
let composite_eval [n] (flags: [n]bool) (vals: [n]i32) : [n]i32 =
  let step (f1: bool, v1: i32) (f2: bool, v2: i32) = 
    (f1 || f2, if f2 then v2 else v1 + v2)
  in (scan step (false, 0) (zip flags vals)).1
Runic Tags: #futhark #composite #scan #parallel