The Visitor: Structural Transmutation
Traverse non-uniform structures, mapping disparate effects natively.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Visitor
ARCANUM SCHOOL: Divination // Flow
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
type node = #leaf i32 | #branch (i32, i32)
let visit (n: node) : i32 =
match n
case #leaf v -> v
case #branch (l, r) -> l + r
let process_forest [n] (forest: [n]node) : [n]i32 =
map visit forest
Runic Tags:
#futhark
#visitor
#trees