this post was submitted on 03 Jun 2025
2 points (100.0% liked)

Idris

96 readers
2 users here now

founded 4 years ago
MODERATORS
 

I've been learning good old Haskell, mostly liking it, but one thing I really dislike is the way exceptions are handled.

It's frustrating that any function can throw just about anything, and this isn't reflected in it's type. Too many times my seemingly sound programs have came crashing down at runtime because some dependency decided to throw an exception. I much prefer the Rust way of doing things where errors are communicated by just returning a value describing it, and panics are reserved for serious trouble (out of memory and the like).

So with that in mind, is Idris for me? I assume that all the usual FP stuff is fine, but how are the exceptions handled?

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 1 points 2 weeks ago

Yeah I find myself doing something similar in Haskell too. Catching exceptions only to return them as Left.