compile matches into executable decision trees

This commit is contained in:
sneeker committed 2020-02-28 12:00:00 +00:00
1 parent a3c6216bb6
commit 048910f945
1 file changed
+8
+8
View File
@@ -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