Abstract Factory in ReasonML
A functional factory of factories for web hexes.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Abstract Factory
ARCANUM SCHOOL: Conjuration // Pact-Making
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// REASON PATTERN //
module type WidgetFactory = {
type button;
type window;
let createButton: unit => button;
let createWindow: unit => window;
};
module MacFactory: WidgetFactory = {
type button = string;
type window = string;
let createButton = () => "MacButton Rune";
let createWindow = () => "MacWindow Hex";
};
The Abstract Factory seals a functional pact, ensuring that the conjured UI hexes remain bound to their specific aesthetic dimensions.
Runic Tags:
#reason
#factory
#creational