Interesting approach to emulating sum types in Go: define an interface with a placeholder function on all of the relevant types! https://www.jerf.org/iri/post/2917
Includes an example with an AST type. You can even stop people extending your interface by making your placeholder private.
miniblog.
Related Posts
I've been tinkering with an LLM interface with my calendar and it's really nice to use.
"Delete my April trip" is a lot less fiddly than opening calendar, switching to the month view, scrolling to April and so on.
I should probably build an undo as well though.
An interesting feature of the Grok TiddlyWiki interface: it has the sidebar on the right.
I see a sidebar on the left way more often, but arguably it makes more sense on the right for a wiki? The content is effectively more prominent.
Optimising GHC, implementing assembly pretty-printers, and the tradeoffs of implementing against an interface: https://www.tweag.io/blog/2022-12-22-making-ghc-faster-at-emitting-code/

