Oooops, accidentally spent most of the afternoon thinking about state machines instead of working on my talk. Think I'm onto something fun though (and probably should write in a longer fashion about it at some point).
-
-
Yeah maybe the answer is that it only works for Self::A -> Self::B, taking ownership of Self each time. I mean, it's not perfect but it would remove a lot of boilerplate when trying to store the states inside another struct (something the first example doesn't even try).
Show this threadThanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
This makes me think of the type/constructor vs. type class/instance correspondence that you see pop up a lot in Tagless Final, which is also related to GADT as mentioned. Basically, there a re many ways to implement dispatch.
-
I've not thought about this in detail, but Tagless Final allows typed dispatch for languages that do not have GADTs. I don't see why that wouldn't work for Rust. Probably someone already has a clear blog post about this.
- 1 more reply
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.