Skip to content

Should context-manipulating functions return effectful unit instead of context? #46

Closed
@aztecrex

Description

@aztecrex

The context-manipulating functions all return a context in Eff. However, the original
context is modified by the function. For do notation, this adds the noise of either
void-ing operations or capturing their values to underscores. I understand there is
purescript-free-canvas but that is not yet in package-sets so I hesitate to use it.

In fact, because of the Graphics.Canvas API, I originally (wrongly) assumed that I
had to capture each context and pass it to the next operation. In this API, the types
don't tell the story which makes it harder to learn.

I propose that such operations return an Eff Unit instead of Eff Context2D. That
is a breaking change, of course, so no PR yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions