Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Serious question, not dismissing any of your work but why implement it yourself when there's plenty of such implementations in TS land already.

fp-ts has an Either type e.g. but there's plenty of such libraries.

https://gcanti.github.io/fp-ts/modules/Either.ts.html



Hi, no worries, I understand your question.

I thought that most of the use cases for such a library could be boiled down to a single function that can wrap throwable pieces of code and convert their result to a Result type and that's exactly what I implemented.

I also wanted minimal amount of methods for the Result variant classes and delightful method names so I tried to do that and I'm happy with the results! (no pun intended)

It's just a little side project, not much thought has been put inside of it except the core idea behind it that I just explained.


The post says why.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: