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

Implement stream fusion #5

Open
superbobry opened this issue Apr 3, 2013 · 1 comment
Open

Implement stream fusion #5

superbobry opened this issue Apr 3, 2013 · 1 comment

Comments

@superbobry
Copy link
Member

Trivial example:

BS.map f $ BS.map g bs => BS.map (f. g) bs
@treeowl
Copy link
Contributor

treeowl commented Jun 9, 2016

We can implement a map/map rule quite easily, without a full stream fusion framework. This particular rule can potentially increase definedness, since BS.map is strict and only accepts non-negative element values, but that's not necessarily a big problem. The general case of GS.map is trickier, at least as currently implemented. For example, with Data.BitSet.Word, mapping with a function producing "out of range" values can give a meaningful result, but it won't compose with its inverse. This could be managed through documentation, but it would be good to improve the out-of-range story generally.

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

No branches or pull requests

2 participants