File tree Expand file tree Collapse file tree 4 files changed +20
-9
lines changed
typed-protocols-stateful/src/Network/TypedProtocol/Stateful
typed-protocols/src/Network/TypedProtocol Expand file tree Collapse file tree 4 files changed +20
-9
lines changed Original file line number Diff line number Diff line change 1
- index-state : 2025-01-30T00:54 :30Z
1
+ index-state : 2025-05-05T00:00 :00Z
2
2
3
3
packages : ./typed-protocols
4
4
./typed-protocols-cborg
@@ -11,11 +11,8 @@ test-show-details: direct
11
11
12
12
if impl(ghc >= 9.12 )
13
13
allow-newer :
14
- -- https://github.com/well-typed/cborg/pull/339
15
- , cborg :base
16
- , cborg :ghc-prim
17
- , serialise :base
18
- , serialise :ghc-prim
14
+ , serdoc-core :template-haskell
15
+ , serdoc-core :th-abstraction
19
16
20
17
if os(windows)
21
18
package text
Original file line number Diff line number Diff line change @@ -40,7 +40,7 @@ library
40
40
, base64-bytestring >= 1.2.1.0 && < 1.3
41
41
, blaze-html >= 0.9.1.2 && < 0.10
42
42
, bytestring >= 0.11 && < 0.13
43
- , containers >= 0.6.8 && < 0.7
43
+ , containers >= 0.6.8 && < 0.8
44
44
, fgl >= 5.7 && < 5.9
45
45
, filepath >= 1.4.2.2 && < 1.6
46
46
, graphviz >= 2999.20.1 && < 2999.21.0
@@ -51,7 +51,7 @@ library
51
51
, template-haskell >= 2.13.0.0
52
52
, temporary >= 1.3 && < 1.4
53
53
, text >= 1.1 && < 2.2
54
- , th-abstraction >= 0.6.0.0 && < 0.7
54
+ , th-abstraction >= 0.6.0.0 && < 0.8
55
55
, time >= 1.12 && < 1.14
56
56
, serdoc-core
57
57
, typed-protocols
Original file line number Diff line number Diff line change @@ -67,7 +67,14 @@ import Network.TypedProtocol.Core as Core
67
67
-- 'Network.TypedProtocol.Peer.Client' or 'Network.TypedProtocol.Peer.Server'
68
68
-- pattern synonyms provide this evidence automatically.
69
69
--
70
- -- TODO:
70
+ -- __NOTE__:
71
+ -- one should not allocate resources within a `Peer` since there's no way to
72
+ -- safely clean-up resources in case of an asynchronous exception. The proper
73
+ -- way to allocate resources is to call
74
+ -- `Network.TypedProtocol.Stateful.Driver.runPeerWithDriver` within
75
+ -- a `Control.Exception.bracket`.
76
+ --
77
+ -- __TODO__:
71
78
-- We are not exposing pipelined version, since it is not possible to write
72
79
-- a driver & proofs in a type safe which take into account the state when the
73
80
-- peer type only tracks depth of pipelining rather than pipelined transitions.
Original file line number Diff line number Diff line change @@ -79,6 +79,13 @@ import Network.TypedProtocol.Core as Core
79
79
-- "Network.TypedProtocol.Peer.Client" supply this evidence for you, and hence
80
80
-- are easier to use and let you avoid some kinds of type errors.
81
81
--
82
+ -- __NOTE__:
83
+ -- one should not allocate resources within a `Peer` since there's no way to
84
+ -- safely clean-up resources in case of an asynchronous exception. The proper
85
+ -- way to allocate resources is to call
86
+ -- `Network.TypedProtocol.Driver.runPeerWithDriver` (or `runPeer`,
87
+ -- `runPipelinedPeer`) within a `Control.Exception.bracket`.
88
+ --
82
89
type Peer :: forall ps
83
90
-> PeerRole
84
91
-> IsPipelined
You can’t perform that action at this time.
0 commit comments