Algebraic Data Types - Retrospective 2018-06-25

By Max Woerner Chase

In this post:


So, how did this first week on the new schedule go? Well, it seems like it's probably not the best idea to get into coding a project before its dependencies are officially released; I think Structured Data could have gotten by just fine with more design before coding. In my defense, I had not realized that typing.Generic is kind of broken until 3.6.6. Like, that was an issue that I could not have anticipated without just writing some dang code.

So far as the plan, I intended to write tests for various happy and error paths; I think I got more error paths than happy paths, and so there's a big hole in coverage around all of the different permissible syntaxes for type annotations, some of which I'll need to experiment with in 3.7 before I feel comfortable writing tests for them. I also wanted to improve the documentation. I didn't get so far there because I managed to break Read the Docs in what appears to be an obscure fashion, and it's hard to be excited about updating documentation when it's not going to show up on the website. I should be able to fix that without breaking CI soon.

Once I have the CI switched to 3.7, I want to do a big push on ergonomic considerations. Stuff like making it easy to create an extract pattern bindings, probably using a lot of __getattribute__ overrides to deal with names rather than strings. I also want to shrink down and separate modules. I should also focus on the generated documentation for the Constructors.

Other future directions I could take include looking into support for type checkers besides mypy, though that'd be lower priority, since for now I only plan to use it with mypy. There are also some open questions on how the generated __new__ function for the Constructors should look, since there are a fixed number of arguments of known type, but no name, which is really hard for me to wrap my head around documenting. I could try using numbered arguments instead? Like, 0, 1, 2, 3...

Hopefully, I'll be able to get some good thinking time in, do a little tweaking on the side, and make a lot more progress the next time around.


Next week, I want to try switching away from coding for a bit. Haven't yet decided what to do instead.