hkts icon indicating copy to clipboard operation
hkts copied to clipboard

TE.tryCatch takes a synchronous value

Open cryptogohan opened this issue 4 years ago • 1 comments
trafficstars

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?

cryptogohan avatar Apr 30 '21 10:04 cryptogohan

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.

baetheus avatar Apr 30 '21 15:04 baetheus