The Factory Method of the Ancestral Monad
Deferring instantiation to pure functions that embody the Ancestral Monad's will.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Factory Method
ARCANUM SCHOOL: Conjuration // Ancestral Monad
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// MIRANDA PATTERN //
|| The Factory Method delegates the pure essence creation.
entity ::= Fire string | Water string
creator :: string -> entity
creator "flame" = Fire "Burning Monad"
creator "drop" = Water "Flowing Monad"
creator _ = Fire "Default Spark"
manifest :: entity -> string
manifest (Fire name) = "Manifesting Fire: " ++ name
manifest (Water name) = "Manifesting Water: " ++ name
invoke_factory :: string -> string
invoke_factory type_str = manifest (creator type_str)
Runic Tags:
#miranda
#creational
#factory-method
#ancestral-monad