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

Optimize (>>) for Seq #62

Closed
treeowl opened this issue Nov 12, 2014 · 3 comments
Closed

Optimize (>>) for Seq #62

treeowl opened this issue Nov 12, 2014 · 3 comments

Comments

@treeowl
Copy link
Contributor

treeowl commented Nov 12, 2014

In base 4.8, (*>) will be implemented (by default) using (<$), for which Seq, at least, has an optimized implementation. But this won't help (>>) unless it's defined explicitly.

@treeowl treeowl changed the title Optimize (>>) Optimize (>>) for Seq Nov 12, 2014
@foxik
Copy link
Contributor

foxik commented Nov 12, 2014

Patches welcomed :-)

@treeowl
Copy link
Contributor Author

treeowl commented Nov 13, 2014

I'll certainly try. In any case, I realized later that we can do better than using the default *>—in particular, xs *> ys should really be implemented directly, and then >> should be defined in terms of that. There's no reason to calculate id <$ xs at all; instead, we should glue length xs copies of ys together. If there's a magical way to do this, as there is for replicate, then so much the better.

@treeowl
Copy link
Contributor Author

treeowl commented Nov 21, 2014

Fixed by #72

@treeowl treeowl closed this as completed Nov 21, 2014
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