Algebraic Data Types 2019-09-04

By Max Woerner Chase

Okay, I'd like to take a break from messing with Structured Data for now, so let's shift gears slightly to look at its Mypy plugin.

This is... oof. I was in the middle of some kind of update to this code before I stopped for some reason, meaning that currently it looks like it probably shouldn't work. Also, the interfaces are drastically changed now.

I mean, I guess the handling for Ctor shouldn't really be different, but aside from that...

Previously, there was a single class decorator, adt. That's been replaced with the Sum base class. In addition, I've added the Product base class, which is a souped-up combination of NamedTuple and dataclasses.

Okay, I've sort of remembered what I was doing: I was copying the way the dataclasses plugin is implemented, and it was full of confusing stubs because I hadn't gotten that far. I've got a little bit of the redo done, but I just realized that, to test this, I'm going to need to release a new version of Structured Data. I'm going to do that, and call that done for today. I don't get much productive done on these entries after 10, anyway.

I'll take care of it while this uploads. Good night.