this post was submitted on 03 Aug 2025
1 points (100.0% liked)

Lobste.rs

233 readers
31 users here now

RSS Feed of lobste.rs

founded 10 months ago
MODERATORS
 

The article explores two ways to manage failure in Haskell. One approach involves passing potential errors forward using types like Maybe or Either, making the possibility of failure explicit. The other takes the opposite route, designing input types that prevent failure in the first place. Using custom types like NonZero or NonEmpty allows developers to avoid many checks later in the code, leading to cleaner, safer programs that rely on strong type guarantees. The idea is to catch problems as early as possible, often right at the boundaries of the system. As a Go developer, it’s always interesting to try to balance very nice concepts from functional-oriented languages and the imperative world without making a mess of it. Comments

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here