Use Gleam’s Result and try for recoverable errors
Use Gleam’s Result type and try expression to handle expected failures without exceptions or nested case blocks.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Use Gleam’s Result type and try expression to handle expected failures without exceptions or nested case blocks.
Gleam replaces thrown exceptions with a pure Result type and a try/catch syntax that pattern‑matches on Ok/Err. This blog walks through a file‑reading pipeline, shows the generated code, and discusses verbosity, bundle size, and JS interop trade‑offs.
Gleam pairs static types and immutable data with BEAM process isolation. This architecture note covers a minimal actor design, Erlang trust boundaries, and operational checks for fault-tolerant services.
Learn how Gleam's FFI interacts with the BEAM, the risks of the trust boundary between static and dynamic types, and how to verify external function signatures using Dialyzer.
When exposing APIs in Gleam, typed structs combined with the gleam/json library give compile‑time guarantees and runtime safety. This architecture note walks through the minimal design, trust boundaries, operational checks, and failure modes that shape a dependable payload layer.
Gleam's `use` keyword turns nested Result case expressions into flat, readable sequences. See how it desugars, where it helps, and what to watch for.
Gleam's custom types make invalid states unrepresentable by forcing exhaustive pattern matching, turning runtime bugs into compile-time errors.
A practical look at using Gleam custom types and exhaustive pattern matching to replace fragile string status fields, with a worked example and honest trade-offs.
Learn how to use gleam_otp to implement Erlang gen_server behaviours and supervision trees in Gleam, with concrete build and verification steps for the Erlang target.