(use-modules (guix monads) (guix store) (srfi srfi-34) (srfi srfi-35)) (define (monadic-procedure) (catch #t (lambda () (guard (c ((message-condition? c) (format (current-error-port) "error: ~a~%" (condition-message c)) (throw c))) (mbegin %store-monad (return (raise (condition (&message (message "Bogus error")))))))) (lambda _ (mbegin %store-monad (return (format #t "Error was caught~%")))))) (with-store store (run-with-store store (monadic-procedure)))