Comment

Comment by marcosdumay

It is so much different because with monads you get the error handling automatically most of the time.

Unless you have very specific requirements for that one line, you don't go writing code like:

    case f x of
        Nothing -> Nothing
        Just y -> case f y of
            Nothing -> Nothing
            Just z -> z
You write:

    do
        y <- f x
        fy
parent marcosdumay 10 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton