ts-failable icon indicating copy to clipboard operation
ts-failable copied to clipboard

Generalizing the framework

Open yang opened this issue 3 years ago • 1 comments

Thanks for the wonderful library!

Would you consider generalizing this beyond error-handling and and threading any monadic context?

I had written something similar for Optional types. Such that you can do (using your syntax):

const key = run(user.username);
const value = run(map.get(key));
// etc.

I thought at least Optional made sense for your library since it already includes related work (deprecated by existential chaining).

yang avatar Mar 30 '21 20:03 yang

Not sure if it is possible to generalize this to all monads in a type-safe way because that would require higher kinded types, which typescript doesn't have. Keeping this open but I highly doubt if this is possible.

dhruvrajvanshi avatar Apr 03 '21 20:04 dhruvrajvanshi