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
While the general useWith and converge from Ramda aren't very well typed, I do find them to be useful functions. One of my main use cases for useWith is to emulate Haskell's on function (this is also known as the psi combinator).
Example:
//Point :: {x, y}constx=prop('x');//Point -> Point -> Numberconstleftmost=on(min,x);constrightmost=on(max,x);
I struggle with the parameter order for this function. In Haskell it's typically used in infix form:
leftmost =min`on` x
As a result, I generally define it using the signature above, even though there could be an argument made that the opposite order makes just as much sense.
Is there enough interest for this to be part of Sanctuary?
The text was updated successfully, but these errors were encountered:
While the general
useWith
andconverge
from Ramda aren't very well typed, I do find them to be useful functions. One of my main use cases foruseWith
is to emulate Haskell'son
function (this is also known as the psi combinator).Example:
I struggle with the parameter order for this function. In Haskell it's typically used in infix form:
As a result, I generally define it using the signature above, even though there could be an argument made that the opposite order makes just as much sense.
Is there enough interest for this to be part of Sanctuary?
The text was updated successfully, but these errors were encountered: