Skip to content

Difference between try and sequence #410

Closed Answered by gdotdesign
tkshnwesper asked this question in Q&A
Discussion options

You must be logged in to vote

Hi 👋

1. `try` does not have a `finally` block

That is correct and it's because try is synchronous.

2. `next` is not used within a `try` block

It can be but it won't be awaited so accessing a state right after a next call will return the previous value.

How far am I right, and are there any more differences?

The fundamental difference is that try is synchronous whereas sequence is asynchronous. In try results (Result(error, value)) are unboxed, in sequence promises (Promise(error, value)) are awaited and unboxed as well.

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@tkshnwesper
Comment options

Answer selected by tkshnwesper
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #409 on May 03, 2021 15:56.