Is there any way to do it faster and better? Better in the sense that search
when adding or
returns all possible combinations
(m/search dx100k
{_ {_ {:db/id ?e
:name "Ivan"}}} ?e)
such a thing works, but for more elements it throws a stackoverflow
(m/rewrite dx100k
(m/map-of _ (m/map-of _ {:db/id !e :name "Ivan"}))
[!e ...])
So I see the ultimate problem. But I’m really not sure if there is a straight forward fix here. Basically we generate some mutually recursive functions that blow the stack. We could definitely be smarter about this. A github issue would be nice if you have the time. (If not I can) Maybe @noprompt has some idea of a good fix for this. But there is a chance we might just hold off on this till zeta. (Unless someone else wants to help fix it which is of course always welcome).
Thanks for opening the ticket!
Jimmy – I’m assuming you’ve come across this in your studies, but just in case you haven’t, you may find it interesting: https://egraphs-good.github.io/