Prototype in Dhall
Clone and modify existing configuration archetypes.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Prototype
ARCANUM SCHOOL: Illusion // Echomancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// DHALL PATTERN //
let Ward = { power : Natural, element : Text, active : Bool }
let defaultWard : Ward = { power = 10, element = "Fire", active = True }
let cloneAndModify =
\(w : Ward) ->
\(newPower : Natural) ->
w // { power = newPower }
in cloneAndModify defaultWard 50
Due to Dhall’s immutable nature, the Prototype pattern is natively represented by its core semantics. Existing records act as prototypes, and the // (record merge) or //\\ (record combine) operators allow an Adept to clone configurations while selectively overwriting the magical properties, yielding a new spell guaranteed to resolve completely.
Runic Tags:
#dhall
#halting
#runes
#configuration
#creational