λ HASKELL SIGILS DIFFICULTY: Adept Creational

The Factory Method

Typeclass-driven conjuration, yielding polymorphic forms from the pure void.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Factory Method
ARCANUM SCHOOL: Conjuration // Voidmancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PURE FUNCTIONAL VOID SIGIL //
module FactoryMethod where
class Spell s where cast :: s -> String
data Fireball = Fireball
instance Spell Fireball where cast _ = "Fireball!"
data Frostbolt = Frostbolt
instance Spell Frostbolt where cast _ = "Frostbolt!"
Runic Tags: #typeclasses #factory #conjuration