Skip to content

First expression in mdo is eagerly evaluated #5

@rymndhng

Description

@rymndhng

I'm seeing that the first expression inside an mdo is always evaluated, which may execute side-effects before the monad is run.

For example:

(mdo 
  failure <- (throw (RuntimeException. "AHA!"))
  _ <- (right :something)      
  :success)

This throws the runtime exception before I try to execute it with monads.core/run-monad

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