Skip to content

A different way to bind #46

@treeowl

Description

@treeowl

I realized it's possible to write

SeqT q >>= f = SeqT $ fmap {- a bunch of gunk -} q

This automatically takes care of making >>= entirely strict in its first argument for strict monad lawfulness as mentioned in #34. Is it a good thing or a bad thing otherwise? Clearly any rewrite rules might need to be adjusted to accommodate it.

One potentially nifty thing: (s >>= f) >>= g becomes, essentially, fmap (gunk g) (fmap (gunk f) s), making it subject to an fmap/fmap fusion law we could write for Queue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions