Skip to content

Conversation

tsuburin
Copy link
Contributor

@tsuburin tsuburin commented Feb 7, 2023

This is what I proposed in #444 , with some superficial modification to match the current APIs.

Closes #444

@k13w
Copy link

k13w commented Mar 4, 2023

nice

const errVal = "err"
const okValues = Array<string>()

const result = safeTry(function*() {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So basically I can do something like

const caller = ():Result<string,MyError> => {
  // foobar: Result<string,MyError>
  const res = yield* foobar().safeUnwrap()
  return res + "hello"
)
}

@0xksure
Copy link

0xksure commented May 23, 2023

Any contributors reviewing this?

@supermacro
Copy link
Owner

Sorry, life recently has made it tough to be as attentive as I used to be. I'll see if I can have a look this coming weekend.

@mklifo
Copy link

mklifo commented Jul 9, 2023

Bump

@tsuburin
Copy link
Contributor Author

Any updates?

@inaiat
Copy link

inaiat commented Sep 5, 2023

Hello!
This PR is awesome! I like a lot!
Any news?

@supermacro
Copy link
Owner

#496

@supermacro supermacro merged commit 9f547a9 into supermacro:master Oct 22, 2023
@supermacro
Copy link
Owner

Would anyone here be willing to contribute to the docs / readme? A few examples would be much appreciated for folks who aren't so familiar with generators as well (myself included).

@supermacro
Copy link
Owner

Extremely basic docs have been added in this commit: 1fd6a05