Skip to content

core/alet works in unexpected way #175

Open
@s-mage

Description

@s-mage

Hi!

Seems like when one of alet args in not wrapped into monad it returns the value of the last of that arg.
Better show than explain:

err.core=> (alet [a (ei/right 1) b (inc a)] 42)
2
err.core=> (alet [a (ei/right 1) b (ei/right (inc a))] 42)
#<Right 42>
err.core=> (alet [a (ei/right 1) b (inc a) c (+ b 4)] 42)

IllegalArgumentException No context is set and it can not be automatically resolved from provided value  cats.context/throw-illegal-argument (context.cljc:32)
err.core=> (alet [a (ei/right 1) b (inc a) c (+ a 4)] 42)
2

I think it should raise exception in all that cases.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions