✨ ARCANUM RUNE DIFFICULTY: Adept Structural

The Bridge: Decoupling Compute Modules

Abstract parallel implementations from their modular interfaces.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Bridge
ARCANUM SCHOOL: Abjuration // Geometry
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
module type MatrixCore = { val compute : i32 -> i32 }

module CyberCore : MatrixCore = { let compute x = x << 1 }

let execute_bridge (core: (i32 -> i32)) [n] (arr: [n]i32) : [n]i32 =
  map core arr
Runic Tags: #futhark #bridge #modules