λ HASKELL SIGILS DIFFICULTY: Adept Creational

The Singleton

A mathematically unbreakable global ward, enforced by the type system.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Singleton
ARCANUM SCHOOL: Abjuration // Type-Theory
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PURE FUNCTIONAL VOID SIGIL //
{-# LANGUAGE DataKinds, GADTs #-}
module Singleton where
data WorldState = Active | Dormant
data SWorldState (s :: WorldState) where SActive :: SWorldState 'Active

invokeActiveWard :: SWorldState 'Active -> String
invokeActiveWard SActive = "The Active Ward is invoked."
Runic Tags: #singleton #types #abjuration