Complex Either Types After Encoding/Decoding: Seeking a Helper for Simplification

Is it normal to end up with types like this after encoding and decoding an Either?

const foo: Either.Left<XeroError | XeroTokenSetPersistenceError | XeroNoRefreshTokenError, {
    readonly id_token?: string | undefined;
    ...
}> | Either.Right<XeroError | XeroTokenSetPersistenceError | XeroNoRefreshTokenError, {
    readonly id_token?: string | undefined;
    ...
}>


Is there a helper to make the types prettier?

Was thinking something like Option.flatten ..
Was this page helpful?