Top
Best
New

Posted by rockyj 10/25/2025

Result is all I need(rockyj-blogs.web.app)
113 points | 97 commentspage 3
phplovesong 3 days ago|
This is why Haxe is awesome. You can target a sloppy langauge and still get the benefits os a ML-like typesystem.
tasuki 3 days ago||
> At the first glance, this code looks noisier and hard to understand

Because of your inconsistent line-breaks!

pshirshov 3 days ago||
Ah, Either. Didn't recognize you from the first glance.

Now we need to invent do-notation, higher kinds and typeclasses and this code would be well composable.

byteshiftlabs 3 days ago||
I love how everyone here shares real experience with Kotlin and Result, it’s cool to see different views that actually teach something.
oweiler 3 days ago||
Use the builtin Result class and runCatching/fold and be done with it. Yes, it has shortcomings but works well enough in practice.
wiseowise 2 days ago||
How to rewrite boring, easily understood code into abomination. I'm not surprised to see Kotlin, for some reason there's a huge inferiority complex in Kotlin community where you have to write the most convoluted pseudo-fp code possible (not smart enough to use ML or Haskell, but still want to flex on Java noobs).

I can't wait until they release rich errors and this nonsense with reinventing checked exceptions will finally end.

DarkNova6 3 days ago|
This is really just a syntactical issue. Not one of types or semantics.

Non trivial operations have errors when the happy path fails. And with web apps IO can fail anytime, anywhere for any reasons.

Sometimes you want to handle them locally, sometimes globally. The question is how ergonomic it is to handle this all for a variety of use cases.

We keep reinventing the wheel because we insist that our own use cases are “special” and “unique”, but they really aren’t.

Personally, I think Java’s proposal on catching errors in switches, next to ordinary data is the right step forward.

Monads are great. You can do lots of great things in them, but ergonomic they are not. We should avoid polluting our type systems where possible.

pornel 3 days ago||
For Turing Complete languages everything is just a syntactical issue (Turing Tarpit).
DarkNova6 3 days ago||
And syntax is what most programmers will complain about. Even if it makes the wrong code easier to type.
DarkNova6 3 days ago||
Ah yes, -2. Predictable result on this emotional topic.