Provide bare and opt set operations#15433
Conversation
|
💚 💙 💜 💛 ❤️ |
|
@josevalim sorry I just noticed this change now, just a couple of questions. I was wondering, if the Also, I didn't fully understand the logic behind
|
|
Yes, you are correct. I decided to go with two separate functions to force whoever is writing code to think exactly which one to use, instead of doing it automatically. :) |
|
Basically, the goal is: whenever we are checking for subtyping, emptiness, etc, we need to perform unions, intersections, differences, and so on. In those cases, we don't want to optimize, so we do bare. Also, once we introduce recursive types, we can't optimize inside constructors, so those are bare too. Everything else can likely be optimized. |
|
Thanks for clarifying! 🙇 |
This pull request breaks set operations (union, intersections, differences, and negations) into
bareandopt(optimized). This is a large PR but most changes are mechanical:Descrmodule use the optimized versionsDescrmodule uses the bare versions for everything, except forto_quotedand type "mutators" (tuple_update, map_delete, etc)Therefore, to review this code, it is best to open up the
descr.exmodule and see if the usage ofopt_*functions within that module are acceptable. There are not many of them.