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

Try to rewrite bind to then #77

Closed
wants to merge 1 commit into from
Closed

Conversation

treeowl
Copy link
Contributor

@treeowl treeowl commented Nov 21, 2014

Add RULES to (effectively) rewrite xs >>= const ys to xs *> ys

Add RULES to (effectively) rewrite xs >>= const ys to xs *> ys
@foxik
Copy link
Contributor

foxik commented Nov 22, 2014

I think we should add {-# INLINE (>>=) #-} (and maybe also for other methods, see for example the GHC's Monad (ST s) instance http://hackage.haskell.org/package/base-4.7.0.1/docs/src/GHC-ST.html) to the instance, so that bindSeq gets to the call site and make rule firing more likely.

BTW, the foldl' is the default definition of Foldable class, which usually has excessive memory complexity, so this is another place where the >>= could be make more effective.

@treeowl
Copy link
Contributor Author

treeowl commented Dec 19, 2014

This may not be worth the fuss. Documentation should cover it.

@treeowl treeowl closed this Dec 19, 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

Successfully merging this pull request may close these issues.

2 participants