Hacker News new | ask | show | jobs
by satvikpendem 969 days ago
Just use a library that already contains this and more functional programming idioms, like fp-ts or its successor, Effect [0]. It is a little more complex to learn but much more robust that simply implementing your own Result and other types.

[0] https://www.effect.website/

2 comments

A great introduction video on Effect: https://www.youtube.com/watch?v=SloZE4i4Zfk
Effect looks great. Strangely enough, I recall dreaming of it and recoiling at how much of a good idea it is -- can't wait to give it a proper go in a project.
"recoiling at how much of a good idea it is"

"recoiling" implies a negative response, ie revulsion or fear

Ahh, most likely meant to say recalling then.