Tag: monads


  • How Writer Monad Supercharges Option Monad

    We’ll revisit the same example from our previous article on the Option<T> monadโ€”a clean way to handle potential failures without drowning in null checks. By now, you’ve seen how the Option<T> monad lets us chain operations smoothly, sidestepping those tedious null inspections at every step. It’s like assembling a puzzle where missing pieces gracefully halt…

  • The only thing you need to reduce nulls: Monad

    Let’s take an example of calculating the delivery estimate given a username. Letโ€™s walk through that journey together and see how a mysterious functional programming concept called a monad can turn nightmare-level null-checks spaghetti into clean, fluent, and safe code. Note: The code snippets here are simplified for clarity and flowโ€”they might not compile straight…