Marin Marinov

Results 6 comments of Marin Marinov

@aleksey-bykov Explicitly threading errors as you suggest in monadic structures is quite hard and daunting task. It takes a lot of effort, makes the code hard to understand and requires...

Monad transformers are a real PITA. You need lifting, hoisting and selective running fairly often. The end result is hardly comprehendible code and much higher than needed barrier of entry....

Back to the OP question - `instanceof` is a dangerous operator to use. However explicit exceptions are not limited to `Error`. You can throw your own ADTs or custom POJO...

@nitzantomer Subclassing native classes (`Error`, `Array`, `RegExp`, etc) was not supported in older ECMAScript versions (prior to ES6). The down level emit for these classes gives unexpected results (best effort...

@nitzantomer I'm not arguing that the suggestion is limited to `Error`. I just explained why it's a bad pattern to subclass it. In my post I actually defended the stance...

I just gave this proposal a second thought and became against it. The reason is that if `throws` declarations were present on signatures but were not enforced, they can already...