compile matches into executable decision trees
This commit is contained in:
1 file changed
+8
@@ -0,0 +1,8 @@
|
||||
data State = Idle | Waiting | Connected
|
||||
|
||||
data Message = Hello Int | Data Int | Close
|
||||
|
||||
match classify (s : State) (m : Message) : Int =
|
||||
| Idle (Hello n) -> n
|
||||
| Waiting (Data n) -> n
|
||||
| Connected Close -> 0
|
||||
Reference in new issue
Block a user