by vmfunction · 2y ago · 0 comments
Maybe give https://gcanti.github.io/fp-ts/ a go?
I really think that TS itself should offer syntax more or less matching what that lib does at the type level, but this is a bit of a maximalist request.
As for fp-ts all APIs have examples/tests that show their usage.
It’s possible there are other aspects of the APIs that differ in meaningful ways, but last I checked virtually all of the libraries with similar functionality (and there are many) have roughly the same concepts until your schemas themselves get deeply complex.
It’s not a very full featured Result, but you can wrap it with your own type.