From d231bb6dde5e543216440399cc449c4f870a37fd Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Thu, 26 Sep 2024 18:38:46 +0200 Subject: [PATCH 1/5] typed-protocols-stateful: haddocks --- .../src/Network/TypedProtocol/Stateful/Peer.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Peer.hs b/typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Peer.hs index a84ef2a..275ef95 100644 --- a/typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Peer.hs +++ b/typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Peer.hs @@ -40,7 +40,7 @@ import Network.TypedProtocol.Core as Core -- -- * the protocol itself; -- * the client\/server role; --- *.the current protocol state; +-- * the current protocol state; -- * the local state type; -- * the monad in which the peer operates; and -- * the type of any final result once the peer terminates. From bf1d91ff0f979c13b88c464471252f5b9244eba8 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Fri, 27 Sep 2024 11:13:15 +0200 Subject: [PATCH 2/5] Updated CHANGELOG.md files --- typed-protocols-cborg/CHANGELOG.md | 8 +++++ typed-protocols-stateful-cborg/CHANGELOG.md | 12 ++++++++ typed-protocols-stateful-cborg/ChangeLog.md | 6 ---- .../typed-protocols-stateful-cborg.cabal | 2 +- typed-protocols-stateful/CHANGELOG.md | 20 +++++++++++++ .../typed-protocols-stateful.cabal | 1 + typed-protocols/CHANGELOG.md | 29 +++++++++++++++---- 7 files changed, 65 insertions(+), 13 deletions(-) create mode 100644 typed-protocols-stateful-cborg/CHANGELOG.md delete mode 100644 typed-protocols-stateful-cborg/ChangeLog.md create mode 100644 typed-protocols-stateful/CHANGELOG.md diff --git a/typed-protocols-cborg/CHANGELOG.md b/typed-protocols-cborg/CHANGELOG.md index adaf451..2cfd50e 100644 --- a/typed-protocols-cborg/CHANGELOG.md +++ b/typed-protocols-cborg/CHANGELOG.md @@ -1,5 +1,13 @@ # Revision history for typed-protocols-cborg +## 0.3.0.0 + +* bumped version to agree with `typed-protocols-stateful-0.3.0.0` + +## 0.2.0.0 + +* updated to use `typed-protocols-0.2.0.0` + ## 0.1.0.0 -- 2021-07-28 * Initial experiments and prototyping diff --git a/typed-protocols-stateful-cborg/CHANGELOG.md b/typed-protocols-stateful-cborg/CHANGELOG.md new file mode 100644 index 0000000..4ce3038 --- /dev/null +++ b/typed-protocols-stateful-cborg/CHANGELOG.md @@ -0,0 +1,12 @@ +# Revision history of typed-protocols-stateful + +## 0.3.0.0 + +* bumped version to agree with `typed-protocols-stateful-0.3.0.0`, in particular: + when encoding the local state associated to the initial message state is + passed to the codec. + +## 0.2.0.0 + +* Initial version + diff --git a/typed-protocols-stateful-cborg/ChangeLog.md b/typed-protocols-stateful-cborg/ChangeLog.md deleted file mode 100644 index adaf451..0000000 --- a/typed-protocols-stateful-cborg/ChangeLog.md +++ /dev/null @@ -1,6 +0,0 @@ -# Revision history for typed-protocols-cborg - -## 0.1.0.0 -- 2021-07-28 - -* Initial experiments and prototyping - diff --git a/typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal b/typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal index c2582b0..1a621fb 100644 --- a/typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal +++ b/typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal @@ -14,7 +14,7 @@ category: Control build-type: Simple -- These should probably be added at some point. -extra-source-files: ChangeLog.md, README.md +extra-doc-files: CHANGELOG.md, README.md library exposed-modules: Network.TypedProtocol.Stateful.Codec.CBOR diff --git a/typed-protocols-stateful/CHANGELOG.md b/typed-protocols-stateful/CHANGELOG.md new file mode 100644 index 0000000..68e4c84 --- /dev/null +++ b/typed-protocols-stateful/CHANGELOG.md @@ -0,0 +1,20 @@ +# Revision history of typed-protocols-stateful + +## 0.3.0.0 + +* when encoding a message the local state associated to the initial message + state, rather than final state, is passed to the codec. For that reason: + * `Yield` requires local state associated to both the initial and final protocol state + * `Codec` and `Driver` have changed accordingly + + This change eliminates the need to have add extra fields in messages which + are not send over the wire, see the `Network.TypedProtocol.Stateful.ReqResp` + example. +* `AnyMessage` takes only the local state associated to the initial protocol state of the `Message`. +* Removed `Show` instance of `AnyMessage`, provided instead `showAnyMessage`. +* `AnyMessageWithAgency` pattern synonym is exported as a constructor of `AnyMessage`. +* constraints of `prop_*` APIs where changed. + +## 0.2.0.0 + +* Initial version diff --git a/typed-protocols-stateful/typed-protocols-stateful.cabal b/typed-protocols-stateful/typed-protocols-stateful.cabal index e2d4312..67c6341 100644 --- a/typed-protocols-stateful/typed-protocols-stateful.cabal +++ b/typed-protocols-stateful/typed-protocols-stateful.cabal @@ -12,6 +12,7 @@ author: Marcin Szamotulski maintainer: marcin.szamotulski@iohk.io category: Control build-type: Simple +extra-source-files: CHANGELOG.md -- These should probably be added at some point. -- extra-source-files: ChangeLog.md, README.md diff --git a/typed-protocols/CHANGELOG.md b/typed-protocols/CHANGELOG.md index 8ad6716..2fa7a36 100644 --- a/typed-protocols/CHANGELOG.md +++ b/typed-protocols/CHANGELOG.md @@ -1,11 +1,28 @@ # Revision history for typed-protocols -## [Unreleased] - -- A major redesign of `typed-protocols`. `Protocol` class requires data family - `Message` and new associated type familiy instance `StateAgency`. One also - needs to define singletons and `Sing` & `SingI` instances from the - [`singletons`][singletons-3.0.1] package. +## 0.3.0.0 + +* `AnyMessageWithAgency` pattern synonym is exported as a constructor of `AnyMessage`. +* Bumped version to agree with `typed-protocols-stateful`. + +## 0.2.0.0 + +* A major redesign of `typed-protocols`. + * `Protocol` class does not require to provide proof obligations for agency. + Proofs are now provided by the framework for all protocols. Agency is now + provided by an associated type family `StateAgency`, and evidence for it, + in form of a singleton, by `StateToken` type family + (similar to `Sing` from the `singletons` package). + * `Peer` takes a different evidence type for agency, + `Network.TypedProtocol.Peer.{Client,Server}` modules provide pattern synonyms + which provide agency evidence and thus are easier to use. + * One `Peer` is provided for both non- and pipelined protocol evolution. + An extra parameter is added of kind `IsPipelined`. As a result + `Outstanding` is now a type family rather than a type alias. + * `ActiveAgency` type class is used to distinguish states in which one side + has an agency (e.g. the protocol hasn't yet terminated), `nonActiveState` can + be used in the same way as `Data.Void.absurd` - which is useful when writing + codecs. ## 0.1.1.1 * unbuildable (with `base < 0` constraint in CHaP); We cannot support From d10afec83828880d374a811ba882b1c881985834 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Fri, 27 Sep 2024 13:16:06 +0200 Subject: [PATCH 3/5] Updated README.md files --- typed-protocols-cborg/README.md | 2 +- typed-protocols-stateful-cborg/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/typed-protocols-cborg/README.md b/typed-protocols-cborg/README.md index 84cb121..0b3deea 100644 --- a/typed-protocols-cborg/README.md +++ b/typed-protocols-cborg/README.md @@ -2,5 +2,5 @@ typed-protocols-cborg ===================== [CBOR](https://hackage.haskell.org/package/cborg) codecs for -[typed-protocols](https://input-output-hk.github.io/ouroboros-network/typed-protocols/Network-TypedProtocol.html) +[typed-protocols](https://input-output-hk.github.io/typed-protocols) package. diff --git a/typed-protocols-stateful-cborg/README.md b/typed-protocols-stateful-cborg/README.md index 16b89de..cb4ebb8 100644 --- a/typed-protocols-stateful-cborg/README.md +++ b/typed-protocols-stateful-cborg/README.md @@ -2,5 +2,5 @@ typed-protocols-stateful-cborg ============================== [CBOR](https://hackage.haskell.org/package/cborg) codecs for -[typed-protocols-stateful](https://input-output-hk.github.io/ouroboros-network/typed-protocols/Network-TypedProtocol-Stateful-Peer.html) +[typed-protocols-stateful](https://input-output-hk.github.io/typed-protocols/typed-protocols-stateful) package. From ebd2425308526543ef4eed431b5b22860b0a0e5e Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Fri, 27 Sep 2024 13:16:18 +0200 Subject: [PATCH 4/5] gha: use ghc-9.8 --- .github/workflows/haskell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 7d43e42..b156dde 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - ghc: ["8.10", "9.2", "9.4", "9.6", "9.10"] + ghc: ["8.10", "9.2", "9.4", "9.6", "9.8", "9.10"] os: [ubuntu-latest, macos-latest, windows-latest] env: From c594b9c97e5a2bd1b392808763f62610ecf5486d Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Fri, 27 Sep 2024 13:17:03 +0200 Subject: [PATCH 5/5] Updated cabal files Updated copyright & tested-with fields. --- typed-protocols-cborg/typed-protocols-cborg.cabal | 4 ++-- typed-protocols-doc/typed-protocols-doc.cabal | 1 - typed-protocols-examples/typed-protocols-examples.cabal | 6 +++--- .../typed-protocols-stateful-cborg.cabal | 1 + typed-protocols-stateful/typed-protocols-stateful.cabal | 6 ++---- typed-protocols/typed-protocols.cabal | 6 +++--- 6 files changed, 11 insertions(+), 13 deletions(-) diff --git a/typed-protocols-cborg/typed-protocols-cborg.cabal b/typed-protocols-cborg/typed-protocols-cborg.cabal index b77d82c..710826e 100644 --- a/typed-protocols-cborg/typed-protocols-cborg.cabal +++ b/typed-protocols-cborg/typed-protocols-cborg.cabal @@ -12,8 +12,8 @@ author: Alexander Vieth, Duncan Coutts, Marcin Szamotulski maintainer: alex@well-typed.com, duncan@well-typed.com, marcin.szamotulski@iohk.io category: Control build-type: Simple -tested-with: GHC == {8.10, 9.2, 9.4, 9.6} -extra-source-files: CHANGELOG.md, README.md +tested-with: GHC == {8.10, 9.2, 9.4, 9.6, 9.8, 9.10} +extra-doc-files: CHANGELOG.md, README.md library exposed-modules: Network.TypedProtocol.Codec.CBOR diff --git a/typed-protocols-doc/typed-protocols-doc.cabal b/typed-protocols-doc/typed-protocols-doc.cabal index bdc55dd..a8117a0 100644 --- a/typed-protocols-doc/typed-protocols-doc.cabal +++ b/typed-protocols-doc/typed-protocols-doc.cabal @@ -12,7 +12,6 @@ category: Network build-type: Simple extra-doc-files: CHANGELOG.md NOTICE --- extra-source-files: common warnings ghc-options: -Wall diff --git a/typed-protocols-examples/typed-protocols-examples.cabal b/typed-protocols-examples/typed-protocols-examples.cabal index 12cb12b..6db9449 100644 --- a/typed-protocols-examples/typed-protocols-examples.cabal +++ b/typed-protocols-examples/typed-protocols-examples.cabal @@ -7,15 +7,15 @@ license: Apache-2.0 license-files: LICENSE NOTICE -copyright: 2019-2023 Input Output Global Inc (IOG) +copyright: 2019-2024 Input Output Global Inc (IOG) author: Alexander Vieth, Duncan Coutts, Marcin Szamotulski maintainer: alex@well-typed.com, duncan@well-typed.com, marcin.szamotulski@iohk.io category: Control build-type: Simple -tested-with: GHC == {8.10, 9.2, 9.4, 9.6} +tested-with: GHC == {8.10, 9.2, 9.4, 9.6, 9.8, 9.10} -- These should probably be added at some point. --- extra-source-files: ChangeLog.md, README.md +-- extra-doc-files: ChangeLog.md, README.md library exposed-modules: Network.TypedProtocol.Channel diff --git a/typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal b/typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal index 1a621fb..9e6baed 100644 --- a/typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal +++ b/typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal @@ -11,6 +11,7 @@ copyright: 2022-2024 Input Output Global Inc (IOG) author: Marcin Szamotulski maintainer: marcin.szamotulski@iohk.io category: Control +tested-with: GHC == {8.10, 9.2, 9.4, 9.6, 9.8, 9.10} build-type: Simple -- These should probably be added at some point. diff --git a/typed-protocols-stateful/typed-protocols-stateful.cabal b/typed-protocols-stateful/typed-protocols-stateful.cabal index 67c6341..9c2e4fb 100644 --- a/typed-protocols-stateful/typed-protocols-stateful.cabal +++ b/typed-protocols-stateful/typed-protocols-stateful.cabal @@ -12,10 +12,8 @@ author: Marcin Szamotulski maintainer: marcin.szamotulski@iohk.io category: Control build-type: Simple -extra-source-files: CHANGELOG.md - --- These should probably be added at some point. --- extra-source-files: ChangeLog.md, README.md +tested-with: GHC == {8.10, 9.2, 9.4, 9.6, 9.8, 9.10} +extra-doc-files: CHANGELOG.md library exposed-modules: Network.TypedProtocol.Stateful.Peer diff --git a/typed-protocols/typed-protocols.cabal b/typed-protocols/typed-protocols.cabal index 0641710..2e6fdcb 100644 --- a/typed-protocols/typed-protocols.cabal +++ b/typed-protocols/typed-protocols.cabal @@ -7,13 +7,13 @@ license: Apache-2.0 license-files: LICENSE NOTICE -copyright: 2019-2023 Input Output Global Inc (IOG) +copyright: 2019-2024 Input Output Global Inc (IOG) author: Alexander Vieth, Duncan Coutts, Marcin Szamotulski maintainer: alex@well-typed.com, duncan@well-typed.com, marcin.szamotulski@iohk.io category: Control build-type: Simple -tested-with: GHC == {8.10, 9.2, 9.4, 9.6} -extra-source-files: CHANGELOG.md +tested-with: GHC == {8.10, 9.2, 9.4, 9.6, 9.8, 9.10} +extra-doc-files: CHANGELOG.md library exposed-modules: Network.TypedProtocol