|
1 | 1 | module Statebox.Core.Types
|
2 |
| - ( module Statebox.Core.Wiring |
3 |
| - , module Statebox.Core.Net |
| 2 | + ( module Statebox.Core.Net |
4 | 3 | , module Statebox.Core.Diagram
|
5 |
| - , Firing |
6 |
| - , GluedTransitionIdRaw |
7 |
| - , GluedTransitionId(..) |
8 |
| - , HexStr |
9 |
| - , Initial(..) |
10 |
| - , Message |
11 |
| - , Singleton |
12 |
| - , TxId |
| 4 | + , module Statebox.Core.Wiring |
| 5 | + , module Statebox.Core.Firing |
| 6 | + , module Statebox.Core.Initial |
| 7 | + , module Statebox.Core.Common |
13 | 8 | ) where
|
14 | 9 |
|
15 |
| -import Prelude |
16 |
| -import Data.Maybe (Maybe) |
17 |
| -import Data.Newtype (class Newtype) |
18 |
| -import Data.NonEmpty (NonEmpty) |
19 |
| - |
20 |
| -import Statebox.Core.Net (Net, PID, TID, unTID) |
21 |
| -import Statebox.Core.Diagram (Diagram) |
22 |
| -import Statebox.Core.Wiring (Wiring) |
23 |
| - |
24 |
| --------------------------------------------------------------------------------- |
25 |
| - |
26 |
| -type Initial = |
27 |
| - { message :: Message |
28 |
| - } |
29 |
| - |
30 |
| --- | Some transaction types have a 'message' field, and they have this type. |
31 |
| -type Message = String |
32 |
| - |
33 |
| --------------------------------------------------------------------------------- |
34 |
| - |
35 |
| -type Firing = |
36 |
| - { message :: Maybe Message |
37 |
| - , execution :: Maybe TxId -- ^ The execution that this firing is a descendent of. |
38 |
| - , path :: Singleton GluedTransitionIdRaw -- ^ The net and transition to fire. |
39 |
| - } |
40 |
| - |
41 |
| -type TxId = String |
42 |
| - |
43 |
| -type HexStr = String |
44 |
| - |
45 |
| --- | This tags an Array that is expected (but not guaranteed) to have exactly one element. (TODO: newtype.) |
46 |
| -type Singleton = NonEmpty Array |
47 |
| - |
48 |
| --- TODO This should be the newtype GluedTransitionId. |
49 |
| -type GluedTransitionIdRaw = Int |
50 |
| - |
51 |
| --------------------------------------------------------------------------------- |
52 |
| - |
53 |
| -newtype GluedTransitionId = GluedTransitionId TID |
54 |
| - |
55 |
| -derive instance newtypeGluedTransitionId :: Newtype GluedTransitionId _ |
56 |
| - |
57 |
| -derive instance eqGluedTransitionId :: Eq GluedTransitionId |
58 |
| - |
59 |
| -instance showGluedTransitionId :: Show GluedTransitionId where |
60 |
| - show (GluedTransitionId i) = "(GluedTransitionId " <> show i <> ")" |
| 10 | +import Statebox.Core.Net |
| 11 | +import Statebox.Core.Diagram |
| 12 | +import Statebox.Core.Wiring |
| 13 | +import Statebox.Core.Firing |
| 14 | +import Statebox.Core.Initial |
| 15 | +import Statebox.Core.Common |
0 commit comments