No title

Anonymous Coward 2018-03-08 07:29:21.514141 UTC

1-- File 1:
2type family EventIdKind (event :: a) :: Type
3type family StateIdKind (event :: a) :: Type
4class (FSM mach) => FSMValidTransition mach (from :: StateIdKind mach) (via :: EventIdKind mach) (to :: StateIdKind mach)
5
6-- File 2:
7 data SMTP
8 type instance StateIdKind SMTP = SMTPStateId
9 type instance EventIdKind SMTP = SMTPEventId
10 data SMTPEventId
11 = VRFY |
12 NOOP |
13 HELO |
14 EHLO |
15 QUIT |
16 RSET |
17 MAIL |
18 RCPT |
19 DATA |
20 DATABody
21 data SMTPStateId
22 = Initial |
23 Greeted |
24 HasSender |
25 HasRecipients |
26 WaitingForBody |
27 Disconnect
28-- [...]
29 instance FSMValidTransition SMTP Initial VRFY Initial
30 instance FSMValidTransition SMTP Initial NOOP Initial
31 instance FSMValidTransition SMTP Initial HELO Greeted
32 instance FSMValidTransition SMTP Initial EHLO Greeted
33 instance FSMValidTransition SMTP Initial QUIT Disconnect
34 instance FSMValidTransition SMTP Greeted VRFY Greeted
35 instance FSMValidTransition SMTP Greeted RSET Greeted
36 instance FSMValidTransition SMTP Greeted NOOP Greeted
37 instance FSMValidTransition SMTP Greeted MAIL HasSender
38 instance FSMValidTransition SMTP Greeted QUIT Disconnect
39 instance FSMValidTransition SMTP HasSender RSET Greeted
40 instance FSMValidTransition SMTP HasSender VRFY HasSender
41 instance FSMValidTransition SMTP HasSender NOOP HasSender
42 instance FSMValidTransition SMTP HasSender RCPT HasRecipients
43 instance FSMValidTransition SMTP HasSender QUIT Disconnect
44 instance FSMValidTransition SMTP HasRecipients RSET Greeted
45 instance FSMValidTransition SMTP HasRecipients VRFY HasRecipients
46 instance FSMValidTransition SMTP HasRecipients RCPT HasRecipients
47 instance FSMValidTransition SMTP HasRecipients NOOP HasRecipients
48 instance FSMValidTransition SMTP HasRecipients DATA WaitingForBody
49 instance FSMValidTransition SMTP HasRecipients QUIT Disconnect
50 instance FSMValidTransition SMTP WaitingForBody DATABody Greeted