Hot take: GUIs have been making "illegal states unrepresentable" pretty well for decades by simply greying out the button.
Conversation
Yes but. In my #elmlang work, I've found it hard to invent a type that ensures "is-disabled" gets set when it should be.
2
2
Need to get into the web browser! This is exactly what the ST type is for! docs.idris-lang.org/en/latest/st/s - I'm sure you could do something crude with phantom types, but it's always going to be more awkward than having true first-class type-level programming.
2
1


