HN user

mibsl

63 karma

U+1F574

Posts3
Comments22
View on HN

This is done so that the programmer doesn't have to reason about it. Polonius makes the compiler accept code that's obviously valid, but the current borrow checker isn't sophisticated enough to declare it as safe.

I've bumped into this kind of problem when writing rust, at first it was hard to understand why the compiler doesn't accept my code.

Short circuiting is a special case of laziness. It's local only, so no thunks are required.

The beauty of functions like fromMaybe is they're only that - just plain, regular functions. No special casing under the hood required.

Haskell's IO monad actually has excellent exception support, including async exceptions and masking them in critical sections.

There are `Maybe` and `Either` and they're great at streamlining error handling in pure code, but when it comes to IO most libraries just throw exceptions (including the standard library).