Diary 2019-03-24

By Max Woerner Chase

I realized something about Structured Data and writing plugins for it: the adt decorator is inspired heavily by the dataclasses module, so I should just... look at the plugin to figure out what's going on there.

What I've worked out so far is that I've changed things enough that a straight copy and paste is mostly not a good idea. I'll try to summarize what's going on when the adt decorator hits a class:

For the methods mentioned here, the self and other parameters should be constrained, not to the same type as each other, but to subclasses of the decorated class.

Other things going on: annotations with a particular type indicate "constructors", which should be modeled as functions accessible only to the decorated class. I don't know if there's a good way to represent that sort of thing.

It looks like I've got two main areas to cover, and I think the way to get started on them is to start adding pseudocode in comments and figure out how to implement them. For now, it's late, and I should sleep.