-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Higher order compose-s #462
Comments
|
@safareli Right, but if you can write it so it works with all functors instead of just functions, why not? |
@masaeedu Can you give an example of how you would want to use |
@gabejohnson Ah, I wasn't aware of that. I guess Maybe it should be called |
The blackbird makes an appearance! const compose2 = S.compose (S.compose) (S.compose);
const insert = compose2 (S.concat) (S.singleton);
insert ('z') (3) ({x: 1, y: 2}); // => {x: 1, y: 2, z: 3} Defining |
It'd be nice to have some utilities to compose functions of 2, 3, etc. arguments with another that transforms the final argument. In Haskell, for example, you can have:
And so on for higher orders with
compose3 = fmap . fmap . fmap
for composing 3 argument functions etc.The text was updated successfully, but these errors were encountered: