persist trees and expose execution and diagnostic commands
This commit is contained in:
2 files changed
+19
No files matched your search
@@ -0,0 +1,15 @@
|
||||
data State = Idle | Waiting | Connected
|
||||
|
||||
data Message = Hello Int | Data Int | Close
|
||||
|
||||
match classify (s : State) (m : Message) : Int =
|
||||
| Idle (Hello n) -> n
|
||||
| Idle (Data n) -> n
|
||||
| Idle Close -> 0
|
||||
| Waiting (Hello n) -> n
|
||||
| Waiting (Data n) -> n
|
||||
| Waiting Close -> 0
|
||||
| Connected (Hello n) -> n
|
||||
| Connected (Data n) -> n
|
||||
| Connected Close -> 0
|
||||
| _ Close -> 0
|
||||
@@ -0,0 +1,4 @@
|
||||
Idle; Hello 5
|
||||
Waiting; Data 3
|
||||
Connected; Close
|
||||
Idle; Data 7
|
||||
Reference in new issue
Block a user