What is typestate?

前端 未结 3 1257
-上瘾入骨i
-上瘾入骨i 2020-12-13 02:14

What does TypeState refer to in respect to language design? I saw it mentioned in some discussions regarding a new language by mozilla called Rust.

3条回答
  •  温柔的废话
    2020-12-13 02:55

    There's a typestate checker written for Java, and Adam Warski's explanatory page gives some useful information. I'm only just figuring this material out myself, but if you are familiar with QuickCheck for Haskell, the application of QuickCheck to monadic state seems similar: categorise the states and explain how they change when they are mutated through the interface.

提交回复
热议问题