extKanren module-toplevel Kleisli function (retry) added by sytse on Fri Feb 5 13:45:43 2021

($λ (() force-block?)
  (#[operative $assert] (not? force-block?))
  ($mlet ((#ignore (>> (|| (=<< /set ($dynamic-variable #[var #goal#] [settable])
                                     (constant "goal"))
                           (=<< /set ($dynamic-variable #[var #state#] [settable])
                                     (constant "state"))
                           (=<< /set ($dynamic-variable #[var #stream#] [settable])
                                     (constant "stream"))
                           (=<< /set ($dynamic-variable #[var #bad-stream#] [settable])
                                     (constant "invalid-stream")))
                       (|| (=<< /set ($dynamic-variable #[var #var#] [settable])
                                     (constant "var"))
                           (=<< /set ($dynamic-variable #[var #var-counter#] [settable])
                                     (constant 0)))
                       (|| (=<< /set ($dynamic-variable #[var #custom-unifier#] [settable])
                                     (constant ()))
                           (=<< /set ($dynamic-variable #[var #custom-≡-processor#] [settable])
                                     (constant ())))))
          (node17 ($dynamic-variable #[var *kernel-module-env*] [settable]))
          (node26 (=<< /environment
                       (pure ())
                       (constant (not-pairᵒ not-nullᵒ
                                            pairᵒ
                                            consᵒ
                                            nullᵒ
                                            ≡
                                            set-state-data
                                            state-data
                                            $run*
                                            $run
                                            $fresh
                                            $condᵉ
                                            conj
                                            disj
                                            fail
                                            succeed
                                            empty-state
                                            var
                                            appendᵒ
                                            $condᵃ
                                            stream-delays
                                            stream-pull
                                            stream-take-all
                                            stream-take
                                            ext-s*
                                            ext-s
                                            unify-triangular
                                            unify
                                            with-custom-≡-processor
                                            with-custom-unifier
                                            reify*
                                            reify
                                            $lazy-choice
                                            unit
                                            choice
                                            walk*
                                            walk
                                            var< ?
                                            var-index
                                            var?
                                            $λ/g
                                            call/goal
                                            mzero
                                            stream?
                                            state?
                                            goal?))
                       (=<< ^list (constant #{wrap:not-pairᵒ})
                                  (constant #{wrap:not-nullᵒ})
                                  (constant #{wrap:pairᵒ})
                                  (constant #{wrap:consᵒ})
                                  (constant #{wrap:nullᵒ})
                                  (constant #{wrap:≡})
                                  (constant #{wrap:set-state-data})
                                  (constant #{wrap:state-data})
                                  (constant #{$run*})
                                  (constant #{$run})
                                  (constant #{$fresh})
                                  (constant #{$condᵉ})
                                  (constant #{wrap:conj})
                                  (constant #{wrap:disj})
                                  (constant (%el:{encap}
                                             %uninterned:{#goal#}
                                             %uninterned:{+fail-goal:λ+}))
                                  (constant (%el:{encap}
                                             %uninterned:{#goal#}
                                             %uninterned:{+succeed-goal:λ+}))
                                  (constant (%el:{encap}
                                             %uninterned:{#state#}
                                             ()))
                                  (constant #{wrap:var})
                                  (constant #{wrap:appendᵒ})
                                  (constant #{$condᵃ})
                                  (constant #{wrap:stream-delays})
                                  (constant #{wrap:stream-pull})
                                  (constant #{wrap:stream-take-all})
                                  (constant #{wrap:stream-take})
                                  (constant #{wrap:ext-s*})
                                  (constant #{wrap:ext-s})
                                  (constant #{wrap:unify-triangular})
                                  (constant #{wrap:unify})
                                  (/call-elisp %el:{kernel-make-dynamic-binder} %uninterned:{#custom-≡-processor#})
                                  (/call-elisp %el:{kernel-make-dynamic-binder} %uninterned:{#custom-unifier#})
                                  (constant #{wrap:reify*})
                                  (=<< /wrap (/inline #{reify}))
                                  (constant #{$lazy-choice})
                                  (constant #{wrap:unit})
                                  (constant #{wrap:choice})
                                  (constant #{wrap:walk*})
                                  (constant #{wrap:walk})
                                  (constant #{wrap:var< ?})
                                  (constant #{wrap:var-index})
                                  (/call-elisp %el:{kernel-make-predicate} %uninterned:{#var#})
                                  (constant #{$λ/g})
                                  (constant #{wrap:call/goal})
                                  (constant (%el:{encap}
                                             %uninterned:{#stream#}))
                                  (/call-elisp %el:{kernel-make-predicate} %uninterned:{#stream#})
                                  (/call-elisp %el:{kernel-make-predicate} %uninterned:{#state#})
                                  (/call-elisp %el:{kernel-make-predicate} %uninterned:{#goal#})))))
    (>> (/set node17 node26)
        (^block-return #inert))))