✨ ARCANUM RUNE DIFFICULTY: Apprentice Creational

The Prototype

Cloning Gallina Wards by deep structural mirroring, bypassing the cost of planar summoning.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Prototype
ARCANUM SCHOOL: Illusion // Shadowcasting
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
(* Gallina Ward: Prototype *)
Require Import String.

Record Construct := mkConstruct {
  id : nat;
  schematic : string;
  integrity : nat
}.

(* In purely functional Gallina, cloning is simply copying the record,
   optionally mutating specific fields. *)
Definition clone (c : Construct) (newId : nat) : Construct :=
  {| id := newId;
     schematic := c.(schematic);
     integrity := c.(integrity) |}.
     
Definition alphaWard : Construct := mkConstruct 1 "Aegis" 100.
Definition betaWard : Construct := clone alphaWard 2.
Runic Tags: #prototype #gallina #wards