for which the return type ({ userInfo: UserInfo, roles: Roles } -!-> Undefined) -!-> Undefined (and more generally, the type (a -!-> r) -!-> r) forms a monad.
We're changing our perspective so that all of our impure functions of multiple arguments can instead be interpreted as pure functions that accept one less argument and return an impure, callback-accepting computation with possibility of failure.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Pablo. What currying is doing for this code is turning an impure function of type (ignoring errors for simplicity):
, which is not a monadic value, into a pure function of the type:
for which the return type
({ userInfo: UserInfo, roles: Roles } -!-> Undefined) -!-> Undefined
(and more generally, the type(a -!-> r) -!-> r
) forms a monad.We're changing our perspective so that all of our impure functions of multiple arguments can instead be interpreted as pure functions that accept one less argument and return an impure, callback-accepting computation with possibility of failure.