Been forever since I used Haskell, and not used Idris (hi from scaled).
Currently actively developing in TypeScript with the fp library Effect.
It essentially has a tryCatch function to lift exceptions into an Effect
(like an Either
type). Since TypeScript doesn't expose exceptions in the type system, its the only way to get errors from other libraries into the type system. They come in without types so we wrap them in our own errors types.