This makes pops work similarly to jsonnet objects. Extending a pop is much easier. You just call the pop with the attribute set to extend it with.
The __functor I added has some magic, where it can detect if you just pass it an attrset, a function with one argument, or two arguments and pass arguments appropriately. I think this makes the process of updating pops more elegant. Without it though, I think we could just force the argument passed to the functor be an Extension.
p = pop { defaults.a = 0; }
p { a = 1; }
p (self: { a = 1; b = self.b; })
p (self: super: { a = super.a + 1; b = self.a; })
This makes pops work similarly to jsonnet objects. Extending a pop is much easier. You just call the pop with the attribute set to extend it with.
The
__functor
I added has some magic, where it can detect if you just pass it an attrset, a function with one argument, or two arguments and pass arguments appropriately. I think this makes the process of updating pops more elegant. Without it though, I think we could just force the argument passed to the functor be an Extension.