Skip to content
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

Operators as functions, and partial application of operators #125

Open
Seirdy opened this issue Feb 22, 2023 · 2 comments
Open

Operators as functions, and partial application of operators #125

Seirdy opened this issue Feb 22, 2023 · 2 comments

Comments

@Seirdy
Copy link

Seirdy commented Feb 22, 2023

LiveScript (a descendant of CoffeeScript that also supports features like pipes and spread operators) supports operators as functions, with partial application.

This allows for Polish-like notation:

(in [1 to 3]) 2  # true

It also combines well with pipes:

111 |> (+) 222  # 333

I'd love to see this in Yuescript.

@vendethiel
Copy link

(LiveScript's biop are just Haskell's operator sections)

@pigpigyyy
Copy link
Owner

pigpigyyy commented Feb 27, 2023

The in operator is useful to make many comparing expressions simpler, but I'm not getting the use for operator function with partial application, it won't be hard to write functions to generate currying functions, why this should be a builtin feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants