λ HASKELL SIGILS DIFFICULTY: Adept Structural

The Proxy

Lazy thunks acting as arcane gateways to deferred computations.

✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Proxy
ARCANUM SCHOOL: Abjuration // Gateway
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// PURE FUNCTIONAL VOID SIGIL //
module Proxy where
heavyComputation :: Int -> Int
heavyComputation x = sum [1..100000] + x
-- Lazy evaluation in Haskell is a built-in proxy!
proxyVal = heavyComputation 10
Runic Tags: #proxy #laziness #structural