8000 In addition to implicit lambdas, also add implicit partial application for operator functions · Issue #258 · evhub/coconut · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
In addition to implicit lambdas, also add implicit partial application for operator functions #258
Closed
@evhub

Description

@evhub

Broken off of #36. From that issue:

@evhub: In addition to implicit lambdas as was implemented here, I think it would also be a good idea to add implicit operator functions using the (? + 5) syntax, which would be equivalent to (+)$(?, 5), since I think the former is a lot easier to read. Reopening this issue to add that syntax.
@fredcallaway: I don't love the idea of a special syntax restricted to operator expressions. Can you come up with a syntax that works cleanly for both (? + 5) and (foo(?) + 5)? For example, something like option 3 above.
@evhub: @fredcallaway The syntax (-> _ + 5) or (-> foo(_) + 5) was already added and handles those use cases. The rationale for (? + 5) is that it would generate a partially-applied operator function instead of a lambda, which is significantly better for pickling, casting to a str, profiling, etc.
@evhub: Maybe the right solution is just to detect implicit lambdas of the form (-> _ + 5) and automatically compile them to partially-applied operator functions, but that seems too implicit and weird to me, so I'm wary to do it.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0