Some features that I'd like to contribute from my personal implementation that this one is missing. Opening issue for discussion before just opening a pull request to help eliminate unnecessary work. Some of these are convenience, some of these bring the implementations closer to the Rust spec. Porting these is little effort, as the code already exists in my own personal work.
Convenience helpers
Spec compliance
Some features that I'd like to contribute from my personal implementation that this one is missing. Opening issue for discussion before just opening a pull request to help eliminate unnecessary work. Some of these are convenience, some of these bring the implementations closer to the Rust spec. Porting these is little effort, as the code already exists in my own personal work.
Convenience helpers
function fromPromise<V, E extends Error>(promise: Promise<V>): Promise<Result<V, E>>; avoids additional microtasksfunction fromSync<V, E extends Error>(func: () => V): Result<V, E>; synchronous helper, avoids microtasks completelySymbol.toStringTagsupport; useful to quickly and easily distinguish resulting objectsSymbol.hasInstancesupport onErr,Ok,Some,None; examplemyResult instance of ErrSpec compliance
class Result<T, E extends Error> implements Iterable<T>Result.expectErr