Using Haskell STM for Atomic Shared State: An Architecture Note
Explore how Haskell's STM provides a minimal, safe design for concurrent shared state, covering requirements, boundaries, checks, failure modes, and when to switch designs.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Explore how Haskell's STM provides a minimal, safe design for concurrent shared state, covering requirements, boundaries, checks, failure modes, and when to switch designs.
Learn how to use Haskell's Algebraic Data Types (ADTs) and pattern matching to eliminate illegal states in your domain models and leverage compiler-driven exhaustiveness checks.
Learn how to spot, diagnose, and fix space leaks caused by lazy I/O in Haskell programs using RTS stats, heap profiling, and strict I/O replacements.
Long-running Haskell services leak memory through lazy thunks in accumulators. Here's how BangPatterns, strict fields, and StrictData fix it — plus the WHNF trap and how to verify the fix with +RTS -s.
Goal Upgrade a small Haskell application from GHC 9.6 to GHC 9.8, targeting a specific Stackage LTS snapshot, while avoiding downtime during the build and deployment cycle. Constraints and Uncertainty Ambiguous type variable warnings may surface when the code uses custom type families or newtype wrappers not fully resolved by the snapshot. Reproducible build
Goal A Haskell program prints non-ASCII text to stdout and succeeds on a UTF-8 developer machine, but the same compiled binary raises a text-decoding exception in a minimal production container. The goal is to diagnose whether GHC's default handle encoding follows the C library locale. Constraints GHC 7.8 and later open stdin, stdout, and stderr using the lo
Lazy I/O and Resource Retention Lazy I/O operations in Haskell's System.IO module defer file reading until data is actually consumed. This lazy evaluation model can cause file handles to remain open longer than expected in long-running computations, particularly when intermediate processing stages retain references to unevaluated thunks containing I/O action
Ambiguous local time conversion failure in Data.Time.Calendar Data.Time.Calendar functions assume the Gregorian calendar and lack a built‑in representation for local times that occur twice during the fall‑back of daylight‑saving time. The library’s timezone and zi functions are deprecated in recent GHC releases, and migration to the tzdata package introduces
The goal is to instrument a Haskell application with ekg for custom metric collection and use prometheus‑haskell to expose those metrics through an HTTP /metrics endpoint so that Prometheus can evaluate alert rules. It is unclear whether ekg’s counters, gauges, and histograms are automatically picked up by the prometheus‑haskell registry or must be manually