Skip to content

a lazier plus function? #6

@michaelsbradleyjr

Description

@michaelsbradleyjr

I've been studying the library and its test suite, trying to come to terms with monads.

I became interested in the test which is commented out on line 269 in test/core.clj.

Is the problem with maybe-monad as such? Or is it a "laziness issue" with respect to the plus function defined on line 13 in monads/core.clj?

Here are the relevant bits of a hack which I cooked up today:

https://gist.github.com/3989325

It's ugly, and I realize that bringing eval into the picture isn't a proper solution. Also, with that hack in place, other parts of the library don't work correctly and many of its tests fail.

This is a learning exercise for me, and you may already be aware of the underlying problem, but I wanted to share my "hack" and get your thoughts on how a "lazier" plus / plus-step might be properly implemented.

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