Skip to content
This repository has been archived by the owner on May 3, 2021. It is now read-only.

TE.tryCatch takes a synchronous value #18

Open
cryptogohan opened this issue Apr 30, 2021 · 1 comment
Open

TE.tryCatch takes a synchronous value #18

cryptogohan opened this issue Apr 30, 2021 · 1 comment

Comments

@cryptogohan
Copy link

In fp-ts tryCatch is how we interop and construct a TaskEither from an asynchronous computation that may fail.

Can I ask why you deviated here and added fromFailableTask?

@baetheus
Copy link
Member

For Either and Option the tryCatch function takes a synchronous thunk. Rather than change that arbitrarily for TaskEither as fp-ts does I opted to make the interface less surprising. Thus the more explicit fromFailableTask function.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants