You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This question illustrates confusion about the fromPromise function which I think was, in part, caused by the naming of the function.
From Promise suggests that the function takes in a Promise and returns a Future. In fact it encases a function which returns a Promise to return a Future instead, very similar to the encase family of functions.
To make the similarities between the two families of functions more apparent, I'm thinking to rename fromPromise to encaseP. This would also naturally provide a name for encaseP(f, undefined): tryP(f).
The text was updated successfully, but these errors were encountered:
This question illustrates confusion about the
fromPromise
function which I think was, in part, caused by the naming of the function.From Promise suggests that the function takes in a Promise and returns a Future. In fact it encases a function which returns a Promise to return a Future instead, very similar to the
encase
family of functions.To make the similarities between the two families of functions more apparent, I'm thinking to rename
fromPromise
toencaseP
. This would also naturally provide a name forencaseP(f, undefined)
:tryP(f)
.The text was updated successfully, but these errors were encountered: