Skip to content

Commit f66e25b

Browse files
epostmarcosh
authored andcommittedFeb 26, 2020
[#328] [stbx-proto] Don't depend on halogen-petrinet-editor for type Marking.
1 parent 1018e92 commit f66e25b

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed
 

‎stbx-protocol/spago.dhall

+1-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@
33
, name =
44
"stbx-protocol"
55
, dependencies =
6-
[ "halogen-petrinet-editor"
7-
, "stbx-core"
8-
, "stbx-tx-store"
9-
, "studio-common"
10-
]
6+
[ "stbx-core", "studio-common", "stbx-tx-store" ]
117
, packages =
128
./../packages.dhall
139
}
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
module Statebox.Protocol.ExecutionState where
22

33
import Statebox.Core.Transaction (TxId)
4-
import View.Petrinet.Model (Marking)
4+
import Statebox.Core.Types (PID)
5+
import Data.Petrinet.Representation.Marking (MarkingF)
56

67
type ExecutionState =
78
{ lastFiring :: TxId
89
, wiring :: TxId
910
, marking :: Marking
1011
}
12+
13+
-- TODO dedupe
14+
type Marking = MarkingF PID Tokens
15+
type Tokens = Int

‎stbx-protocol/src/Statebox/Protocol/Fire.purs

+6-2
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ import Data.Maybe (maybe)
88
import Data.NonEmpty (head)
99

1010
import Data.Petrinet.Representation.Dict (fireAtMarking)
11+
import Data.Petrinet.Representation.Marking (MarkingF)
1112
import Statebox.Core.Transition (gluedTokens)
12-
import Statebox.Core.Types (Firing, Wiring)
13+
import Statebox.Core.Types (Firing, Wiring, PID)
1314
import Statebox.Core.WiringTree (LinearizationError, fromWiring, linearize)
14-
import View.Petrinet.Model (Marking)
1515

1616
data FiringError
1717

@@ -42,3 +42,7 @@ fire wiring firing marking = maybe
4242
(index gluedTransitions transitionIndex))
4343
(linearize wiringTree))
4444
(fromWiring wiring)
45+
46+
-- TODO dedupe
47+
type Marking = MarkingF PID Tokens
48+
type Tokens = Int

0 commit comments

Comments
 (0)
Please sign in to comment.