⚙️ DHALL RUNE DIFFICULTY: Apprentice Creational

Factory Method in Dhall

Delegate the instantiation of runic unions to conditional creation logic.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Factory Method
ARCANUM SCHOOL: Conjuration // Portalmancy
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// DHALL PATTERN //
let Transport = < Ship | Hovercraft | Portal >

let createTransport =
      \(isWater : Bool) ->
      \(isMagical : Bool) ->
        if    isMagical
        then  Transport.Portal
        else  if isWater
        then  Transport.Ship
        else  Transport.Hovercraft

in  createTransport False True

The Factory Method in Dhall often utilizes unions to represent the different possibilities of a configuration. The factory itself is a deterministic, guaranteed-halting function that evaluates the world-state variables to return the precise variant required. This shields the broader configuration from complex logic blocks.

Runic Tags: #dhall #halting #runes #configuration #creational