⚙️ PURESCRIPT RUNE DIFFICULTY: Apprentice Creational

The Factory Method of Web Runes

Define an interface for creating a single web rune, delegating instantiation logic.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Factory Method
ARCANUM SCHOOL: Conjuration // Construct Summoning
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PURESCRIPT PATTERN //
module Arcane.FactoryMethod where
import Prelude
import Effect (Effect)
import Effect.Console (log)

data ConstructType = Golem | Homunculus | Servitor

-- The Factory Method Pattern translated to a smart constructor
summonConstruct :: ConstructType -> String
summonConstruct Golem = "Summoning an Earth Golem of pure clay..."
summonConstruct Homunculus = "Brewing a Homunculus in the alchemical vat..."
summonConstruct Servitor = "Binding a cyber-servitor spirit..."

ritualOfSummoning :: ConstructType -> Effect Unit
ritualOfSummoning cType = log $ summonConstruct cType
Runic Tags: #creational #factory-method #purescript #runes