-
Notifications
You must be signed in to change notification settings - Fork 198
Description
It would be great if you could run a drawing in a debug mode, which would let you select shapes, and point you to the source code that drew them. What is this black magic? Actually, all that would be required to is to add a HasCallStack constraint to all of the drawing primitives, and have them store source code references alongside constructors for the Picture
type! Then it's just a matter of building the UI.
Performance is definitely a concern. We'd want to only store the source locations in a Picture when the debugging mode is enabled, and carefully design the code to minimize performance impact when this function isn't used. For example, perhaps the source locs could be stored in an external hash map that's built up as the picture is evaluated, rather than in the ADT itself.