Skip to content

Implement stream fusion #5

Open

Description

@superbobry

Trivial example:

BS.map f $ BS.map g bs => BS.map (f. g) bs

Activity

  1. treeowl commented on Jun 9, 2016

    @treeowl
    Contributor

    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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions