Fork me on GitHub
#meander
<
2021-08-30
>
ribelo13:08:20

Is there any way to catch exception inside lhs?

ribelo13:08:40

idiotic example

(m/rewrite "foo"
  (try (m/pred neg? ?x)) ?x)

ribelo14:08:51

can be done this way, but maybe it can be done simpler?

(m/match "foo"
  (m/and ?x (m/guard (catching (zero? ?x)))) ?x
  _ false)

noprompt15:08:22

@huxley are you asking if m/pred can use try/`catch`?