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

Special Case Fold #199

Open
Maltysen opened this issue Jun 13, 2016 · 1 comment
Open

Special Case Fold #199

Maltysen opened this issue Jun 13, 2016 · 1 comment

Comments

@Maltysen
Copy link
Contributor

Maltysen commented Jun 13, 2016

I realized that we can special case the meta-ops depending on the operators passed into them. The specific motivating example I have is *F.

We can first of all make the multiplicative identity be 1 so that *FY gives 1. Additionally, we can also make ints passed into it no do U but instead S so that it is equivalent to factorial.

We can even take this a step further and make floats return gamma, removing the need for .! altogether.

The last example I have for this is when you *F 2D lists. Right now it applies itertools.product multiple time, which screws everything up. If we can special case, we can just do a itertools.product(*a).

I'm not sure how this would be implemented, but it seems it would be very useful, both for *F in specific, and others in general(maybe &F and |F for all and any).

Thoughts?

@Maltysen Maltysen changed the title Special Case F Special Case Fold Jun 13, 2016
@isaacg1
Copy link
Owner

isaacg1 commented Jul 6, 2017

The easy part of this was implemented in c374b45

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

2 participants