From a6bb1c6047d47d779ba6b5d97066b05e4751378f Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Thu, 12 Dec 2024 12:32:30 +0100 Subject: [PATCH 01/11] typed-protocols: use sublibraries See https://github.com/haskell/cabal/issues/10277, why such long names are used. --- .github/workflows/haskell.yml | 4 +- cabal.project | 4 - typed-protocols-cborg/CHANGELOG.md | 14 -- typed-protocols-cborg/LICENSE | 177 ------------------ typed-protocols-cborg/NOTICE | 14 -- typed-protocols-cborg/README.md | 6 - .../typed-protocols-cborg.cabal | 38 ---- typed-protocols-examples/LICENSE | 177 ------------------ typed-protocols-examples/NOTICE | 14 -- .../typed-protocols-examples.cabal | 109 ----------- typed-protocols-stateful-cborg/CHANGELOG.md | 12 -- typed-protocols-stateful-cborg/LICENSE | 177 ------------------ typed-protocols-stateful-cborg/NOTICE | 14 -- typed-protocols-stateful-cborg/README.md | 6 - .../typed-protocols-stateful-cborg.cabal | 43 ----- typed-protocols-stateful/CHANGELOG.md | 20 -- typed-protocols-stateful/LICENSE | 177 ------------------ typed-protocols-stateful/NOTICE | 14 -- typed-protocols-stateful/README.md | 6 - .../typed-protocols-stateful.cabal | 50 ----- .../Network/TypedProtocol/Codec/CBOR.hs | 0 .../Network/TypedProtocol/Channel.hs | 0 .../Network/TypedProtocol/Driver/Simple.hs | 0 .../Network/TypedProtocol/PingPong/Client.hs | 0 .../Network/TypedProtocol/PingPong/Codec.hs | 0 .../TypedProtocol/PingPong/Codec/CBOR.hs | 0 .../TypedProtocol/PingPong/Examples.hs | 0 .../Network/TypedProtocol/PingPong/Server.hs | 0 .../Network/TypedProtocol/PingPong/Type.hs | 0 .../Network/TypedProtocol/ReqResp/Client.hs | 0 .../Network/TypedProtocol/ReqResp/Codec.hs | 0 .../TypedProtocol/ReqResp/Codec/CBOR.hs | 0 .../Network/TypedProtocol/ReqResp/Examples.hs | 0 .../Network/TypedProtocol/ReqResp/Server.hs | 0 .../Network/TypedProtocol/ReqResp/Type.hs | 0 .../Network/TypedProtocol/ReqResp2/Client.hs | 0 .../Network/TypedProtocol/ReqResp2/Type.hs | 0 .../TypedProtocol/Stateful/ReqResp/Client.hs | 0 .../TypedProtocol/Stateful/ReqResp/Codec.hs | 0 .../Stateful/ReqResp/Examples.hs | 0 .../TypedProtocol/Stateful/ReqResp/Server.hs | 0 .../TypedProtocol/Stateful/ReqResp/Type.hs | 0 .../Network/TypedProtocol/Trans/Wedge.hs | 0 .../TypedProtocol/Stateful/Codec/CBOR.hs | 0 .../stateful}/Network/TypedProtocol.hs | 0 .../Network/TypedProtocol/Stateful/Codec.hs | 0 .../Network/TypedProtocol/Stateful/Driver.hs | 0 .../Network/TypedProtocol/Stateful/Peer.hs | 0 .../TypedProtocol/Stateful/Peer/Client.hs | 0 .../TypedProtocol/Stateful/Peer/Server.hs | 0 .../Network/TypedProtocol/Stateful/Proofs.hs | 0 .../test/Main.hs | 0 .../Network/TypedProtocol/PingPong/Tests.hs | 0 .../Network/TypedProtocol/ReqResp/Tests.hs | 0 typed-protocols/typed-protocols.cabal | 169 +++++++++++++++++ 55 files changed, 171 insertions(+), 1074 deletions(-) delete mode 100644 typed-protocols-cborg/CHANGELOG.md delete mode 100644 typed-protocols-cborg/LICENSE delete mode 100644 typed-protocols-cborg/NOTICE delete mode 100644 typed-protocols-cborg/README.md delete mode 100644 typed-protocols-cborg/typed-protocols-cborg.cabal delete mode 100644 typed-protocols-examples/LICENSE delete mode 100644 typed-protocols-examples/NOTICE delete mode 100644 typed-protocols-examples/typed-protocols-examples.cabal delete mode 100644 typed-protocols-stateful-cborg/CHANGELOG.md delete mode 100644 typed-protocols-stateful-cborg/LICENSE delete mode 100644 typed-protocols-stateful-cborg/NOTICE delete mode 100644 typed-protocols-stateful-cborg/README.md delete mode 100644 typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal delete mode 100644 typed-protocols-stateful/CHANGELOG.md delete mode 100644 typed-protocols-stateful/LICENSE delete mode 100644 typed-protocols-stateful/NOTICE delete mode 100644 typed-protocols-stateful/README.md delete mode 100644 typed-protocols-stateful/typed-protocols-stateful.cabal rename {typed-protocols-cborg/src => typed-protocols/cborg}/Network/TypedProtocol/Codec/CBOR.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/Channel.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/Driver/Simple.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/PingPong/Client.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/PingPong/Codec.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/PingPong/Codec/CBOR.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/PingPong/Examples.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/PingPong/Server.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/PingPong/Type.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/ReqResp/Client.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/ReqResp/Codec.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/ReqResp/Codec/CBOR.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/ReqResp/Examples.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/ReqResp/Server.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/ReqResp/Type.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/ReqResp2/Client.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/ReqResp2/Type.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/Stateful/ReqResp/Client.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/Stateful/ReqResp/Codec.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/Stateful/ReqResp/Examples.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/Stateful/ReqResp/Server.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/Stateful/ReqResp/Type.hs (100%) rename {typed-protocols-examples/src => typed-protocols/examples}/Network/TypedProtocol/Trans/Wedge.hs (100%) rename {typed-protocols-stateful-cborg/src => typed-protocols/stateful-cborg}/Network/TypedProtocol/Stateful/Codec/CBOR.hs (100%) rename {typed-protocols-stateful/src => typed-protocols/stateful}/Network/TypedProtocol.hs (100%) rename {typed-protocols-stateful/src => typed-protocols/stateful}/Network/TypedProtocol/Stateful/Codec.hs (100%) rename {typed-protocols-stateful/src => typed-protocols/stateful}/Network/TypedProtocol/Stateful/Driver.hs (100%) rename {typed-protocols-stateful/src => typed-protocols/stateful}/Network/TypedProtocol/Stateful/Peer.hs (100%) rename {typed-protocols-stateful/src => typed-protocols/stateful}/Network/TypedProtocol/Stateful/Peer/Client.hs (100%) rename {typed-protocols-stateful/src => typed-protocols/stateful}/Network/TypedProtocol/Stateful/Peer/Server.hs (100%) rename {typed-protocols-stateful/src => typed-protocols/stateful}/Network/TypedProtocol/Stateful/Proofs.hs (100%) rename {typed-protocols-examples => typed-protocols}/test/Main.hs (100%) rename {typed-protocols-examples => typed-protocols}/test/Network/TypedProtocol/PingPong/Tests.hs (100%) rename {typed-protocols-examples => typed-protocols}/test/Network/TypedProtocol/ReqResp/Tests.hs (100%) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index b3a0420b..69c2d369 100644 --- a/.github/workflows/haskell.yml +++ b/.github/workflows/haskell.yml @@ -90,8 +90,8 @@ jobs: - name: Build projects [build] run: cabal build all - - name: typed-protocols-examples [test] - run: cabal run typed-protocols-examples:test + - name: typed-protocols:test + run: cabal run typed-protocols:test # - name: typed-protocols-doc [test] # run: cabal test typed-protocols-doc diff --git a/cabal.project b/cabal.project index aa3a5229..00a718ec 100644 --- a/cabal.project +++ b/cabal.project @@ -1,10 +1,6 @@ index-state: 2025-05-05T00:00:00Z packages: ./typed-protocols - ./typed-protocols-cborg - ./typed-protocols-stateful - ./typed-protocols-stateful-cborg - ./typed-protocols-examples ./typed-protocols-doc test-show-details: direct diff --git a/typed-protocols-cborg/CHANGELOG.md b/typed-protocols-cborg/CHANGELOG.md deleted file mode 100644 index 2cfd50eb..00000000 --- a/typed-protocols-cborg/CHANGELOG.md +++ /dev/null @@ -1,14 +0,0 @@ -# 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-cborg/LICENSE b/typed-protocols-cborg/LICENSE deleted file mode 100644 index f433b1a5..00000000 --- a/typed-protocols-cborg/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/typed-protocols-cborg/NOTICE b/typed-protocols-cborg/NOTICE deleted file mode 100644 index 98b65037..00000000 --- a/typed-protocols-cborg/NOTICE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2021-2025 Input Output Global Inc (IOG) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/typed-protocols-cborg/README.md b/typed-protocols-cborg/README.md deleted file mode 100644 index 0b3deea0..00000000 --- a/typed-protocols-cborg/README.md +++ /dev/null @@ -1,6 +0,0 @@ -typed-protocols-cborg -===================== - -[CBOR](https://hackage.haskell.org/package/cborg) codecs for -[typed-protocols](https://input-output-hk.github.io/typed-protocols) -package. diff --git a/typed-protocols-cborg/typed-protocols-cborg.cabal b/typed-protocols-cborg/typed-protocols-cborg.cabal deleted file mode 100644 index 64ea2698..00000000 --- a/typed-protocols-cborg/typed-protocols-cborg.cabal +++ /dev/null @@ -1,38 +0,0 @@ -cabal-version: 3.4 -name: typed-protocols-cborg -version: 0.4.0.0 -synopsis: CBOR codecs for typed-protocols --- description: -license: Apache-2.0 -license-files: - LICENSE - NOTICE -copyright: 2019-2025 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, 9.8, 9.10} -extra-doc-files: CHANGELOG.md, README.md - -library - exposed-modules: Network.TypedProtocol.Codec.CBOR - - build-depends: base >=4.12 && <4.22, - bytestring >=0.10 && <0.13, - cborg >=0.2.1 && <0.3, - singletons, - - io-classes:io-classes ^>=1.7, - typed-protocols ^>=0.4 - - hs-source-dirs: src - default-language: Haskell2010 - ghc-options: -Wall - -Wno-unticked-promoted-constructors - -Wcompat - -Wincomplete-uni-patterns - -Wincomplete-record-updates - -Wpartial-fields - -Widentities - -Wredundant-constraints diff --git a/typed-protocols-examples/LICENSE b/typed-protocols-examples/LICENSE deleted file mode 100644 index f433b1a5..00000000 --- a/typed-protocols-examples/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/typed-protocols-examples/NOTICE b/typed-protocols-examples/NOTICE deleted file mode 100644 index 3d6e49e7..00000000 --- a/typed-protocols-examples/NOTICE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2019-2025 Input Output Global Inc (IOG) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/typed-protocols-examples/typed-protocols-examples.cabal b/typed-protocols-examples/typed-protocols-examples.cabal deleted file mode 100644 index cc6d8ba7..00000000 --- a/typed-protocols-examples/typed-protocols-examples.cabal +++ /dev/null @@ -1,109 +0,0 @@ -cabal-version: 3.4 -name: typed-protocols-examples -version: 0.6.0.0 -synopsis: Examples and tests for the typed-protocols framework --- description: -license: Apache-2.0 -license-files: - LICENSE - NOTICE -copyright: 2019-2025 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, 9.8, 9.10} - --- These should probably be added at some point. --- extra-doc-files: ChangeLog.md, README.md - -library - exposed-modules: Network.TypedProtocol.Channel - , Network.TypedProtocol.Driver.Simple - - , Network.TypedProtocol.PingPong.Type - , Network.TypedProtocol.PingPong.Client - , Network.TypedProtocol.PingPong.Server - , Network.TypedProtocol.PingPong.Codec - , Network.TypedProtocol.PingPong.Codec.CBOR - , Network.TypedProtocol.PingPong.Examples - - , Network.TypedProtocol.ReqResp.Type - , Network.TypedProtocol.ReqResp.Client - , Network.TypedProtocol.ReqResp.Server - , Network.TypedProtocol.ReqResp.Codec - , Network.TypedProtocol.ReqResp.Codec.CBOR - , Network.TypedProtocol.ReqResp.Examples - - , Network.TypedProtocol.ReqResp2.Type - , Network.TypedProtocol.ReqResp2.Client - - , Network.TypedProtocol.Stateful.ReqResp.Type - , Network.TypedProtocol.Stateful.ReqResp.Client - , Network.TypedProtocol.Stateful.ReqResp.Server - , Network.TypedProtocol.Stateful.ReqResp.Codec - , Network.TypedProtocol.Stateful.ReqResp.Examples - - , Network.TypedProtocol.Trans.Wedge - other-extensions: GADTs - , RankNTypes - , PolyKinds - , DataKinds - , ScopedTypeVariables - , TypeFamilies - , TypeOperators - , BangPatterns - build-depends: base, - bytestring, - cborg, - serialise, - singletons, - contra-tracer, - io-classes:{io-classes,si-timers}, - network, - time, - typed-protocols ^>= 0.4, - typed-protocols-cborg, - typed-protocols-stateful, - hs-source-dirs: src - default-language: Haskell2010 - -- ghc-9.2 pulls `ghc-heap-9.12` which is not compatible - if impl(ghc < 9.4) - build-depends: ghc-heap < 9.12 - ghc-options: -Wall - -Wno-unticked-promoted-constructors - -Wcompat - -Wincomplete-uni-patterns - -Wincomplete-record-updates - -Wpartial-fields - -Widentities - -Wredundant-constraints - -test-suite test - type: exitcode-stdio-1.0 - main-is: Main.hs - hs-source-dirs: test - other-modules: Network.TypedProtocol.PingPong.Tests - , Network.TypedProtocol.ReqResp.Tests - build-depends: base - , bytestring - , contra-tracer - , typed-protocols - , typed-protocols-cborg - , typed-protocols-examples - , io-classes:{io-classes,si-timers} - , io-sim - , QuickCheck - , tasty - , tasty-quickcheck - - if !os(windows) - build-depends: directory - , network - , unix - - default-language: Haskell2010 - ghc-options: -rtsopts - -Wall - -Wno-unticked-promoted-constructors - -Wno-orphans diff --git a/typed-protocols-stateful-cborg/CHANGELOG.md b/typed-protocols-stateful-cborg/CHANGELOG.md deleted file mode 100644 index 4ce3038d..00000000 --- a/typed-protocols-stateful-cborg/CHANGELOG.md +++ /dev/null @@ -1,12 +0,0 @@ -# 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/LICENSE b/typed-protocols-stateful-cborg/LICENSE deleted file mode 100644 index f433b1a5..00000000 --- a/typed-protocols-stateful-cborg/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/typed-protocols-stateful-cborg/NOTICE b/typed-protocols-stateful-cborg/NOTICE deleted file mode 100644 index 5f99bd13..00000000 --- a/typed-protocols-stateful-cborg/NOTICE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2022-2025 Input Output Global Inc (IOG) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/typed-protocols-stateful-cborg/README.md b/typed-protocols-stateful-cborg/README.md deleted file mode 100644 index cb4ebb84..00000000 --- a/typed-protocols-stateful-cborg/README.md +++ /dev/null @@ -1,6 +0,0 @@ -typed-protocols-stateful-cborg -============================== - -[CBOR](https://hackage.haskell.org/package/cborg) codecs for -[typed-protocols-stateful](https://input-output-hk.github.io/typed-protocols/typed-protocols-stateful) -package. diff --git a/typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal b/typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal deleted file mode 100644 index c134068a..00000000 --- a/typed-protocols-stateful-cborg/typed-protocols-stateful-cborg.cabal +++ /dev/null @@ -1,43 +0,0 @@ -cabal-version: 3.4 -name: typed-protocols-stateful-cborg -version: 0.4.0.0 -synopsis: CBOR codecs for typed-protocols --- description: -license: Apache-2.0 -license-files: - LICENSE - NOTICE -copyright: 2022-2025 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. -extra-doc-files: CHANGELOG.md, README.md - -library - exposed-modules: Network.TypedProtocol.Stateful.Codec.CBOR - - build-depends: base >=4.12 && <4.22, - bytestring >=0.10 && <0.13, - cborg >=0.2.1 && <0.3, - singletons, - - io-classes, - typed-protocols ^>= 0.4, - typed-protocols-cborg, - typed-protocols-stateful - - hs-source-dirs: src - default-language: Haskell2010 - default-extensions: ImportQualifiedPost - ghc-options: -Wall - -Wno-unticked-promoted-constructors - -Wcompat - -Wincomplete-uni-patterns - -Wincomplete-record-updates - -Wpartial-fields - -Widentities - -Wredundant-constraints diff --git a/typed-protocols-stateful/CHANGELOG.md b/typed-protocols-stateful/CHANGELOG.md deleted file mode 100644 index 68e4c840..00000000 --- a/typed-protocols-stateful/CHANGELOG.md +++ /dev/null @@ -1,20 +0,0 @@ -# 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/LICENSE b/typed-protocols-stateful/LICENSE deleted file mode 100644 index f433b1a5..00000000 --- a/typed-protocols-stateful/LICENSE +++ /dev/null @@ -1,177 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS diff --git a/typed-protocols-stateful/NOTICE b/typed-protocols-stateful/NOTICE deleted file mode 100644 index 5f99bd13..00000000 --- a/typed-protocols-stateful/NOTICE +++ /dev/null @@ -1,14 +0,0 @@ -Copyright 2022-2025 Input Output Global Inc (IOG) - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. - diff --git a/typed-protocols-stateful/README.md b/typed-protocols-stateful/README.md deleted file mode 100644 index 4a9b66e8..00000000 --- a/typed-protocols-stateful/README.md +++ /dev/null @@ -1,6 +0,0 @@ -typed-protocols-stateful -======================== - -A stateful `typed-protocols` version which allows to track state changes along -side protocol transtions. It allows to build codes depends on the current -state. diff --git a/typed-protocols-stateful/typed-protocols-stateful.cabal b/typed-protocols-stateful/typed-protocols-stateful.cabal deleted file mode 100644 index bc0f891f..00000000 --- a/typed-protocols-stateful/typed-protocols-stateful.cabal +++ /dev/null @@ -1,50 +0,0 @@ -cabal-version: 3.4 -name: typed-protocols-stateful -version: 0.4.0.0 -synopsis: A framework for strongly typed protocols --- description: -license: Apache-2.0 -license-files: - LICENSE - NOTICE -copyright: 2022-2025 Input Output Global Inc (IOG) -author: Marcin Szamotulski -maintainer: marcin.szamotulski@iohk.io -category: Control -build-type: Simple -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 - , Network.TypedProtocol.Stateful.Peer.Client - , Network.TypedProtocol.Stateful.Peer.Server - , Network.TypedProtocol.Stateful.Driver - , Network.TypedProtocol.Stateful.Proofs - , Network.TypedProtocol.Stateful.Codec - - other-extensions: GADTs - , RankNTypes - , PolyKinds - , DataKinds - , ScopedTypeVariables - , TypeFamilies - , TypeOperators - , BangPatterns - default-extensions: ImportQualifiedPost - build-depends: base, - contra-tracer, - singletons >= 3.0, - io-classes, - typed-protocols ^>= 0.4 - - hs-source-dirs: src - default-language: Haskell2010 - ghc-options: -Wall - -Wno-unticked-promoted-constructors - -Wcompat - -Wincomplete-uni-patterns - -Wincomplete-record-updates - -Wpartial-fields - -Widentities - -Wredundant-constraints diff --git a/typed-protocols-cborg/src/Network/TypedProtocol/Codec/CBOR.hs b/typed-protocols/cborg/Network/TypedProtocol/Codec/CBOR.hs similarity index 100% rename from typed-protocols-cborg/src/Network/TypedProtocol/Codec/CBOR.hs rename to typed-protocols/cborg/Network/TypedProtocol/Codec/CBOR.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/Channel.hs b/typed-protocols/examples/Network/TypedProtocol/Channel.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/Channel.hs rename to typed-protocols/examples/Network/TypedProtocol/Channel.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/Driver/Simple.hs b/typed-protocols/examples/Network/TypedProtocol/Driver/Simple.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/Driver/Simple.hs rename to typed-protocols/examples/Network/TypedProtocol/Driver/Simple.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/PingPong/Client.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Client.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/PingPong/Client.hs rename to typed-protocols/examples/Network/TypedProtocol/PingPong/Client.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/PingPong/Codec.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/PingPong/Codec.hs rename to typed-protocols/examples/Network/TypedProtocol/PingPong/Codec.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/PingPong/Codec/CBOR.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec/CBOR.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/PingPong/Codec/CBOR.hs rename to typed-protocols/examples/Network/TypedProtocol/PingPong/Codec/CBOR.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/PingPong/Examples.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Examples.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/PingPong/Examples.hs rename to typed-protocols/examples/Network/TypedProtocol/PingPong/Examples.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/PingPong/Server.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Server.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/PingPong/Server.hs rename to typed-protocols/examples/Network/TypedProtocol/PingPong/Server.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/PingPong/Type.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Type.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/PingPong/Type.hs rename to typed-protocols/examples/Network/TypedProtocol/PingPong/Type.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Client.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Client.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Client.hs rename to typed-protocols/examples/Network/TypedProtocol/ReqResp/Client.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Codec.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Codec.hs rename to typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Codec/CBOR.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec/CBOR.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Codec/CBOR.hs rename to typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec/CBOR.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Examples.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Examples.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Examples.hs rename to typed-protocols/examples/Network/TypedProtocol/ReqResp/Examples.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Server.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Server.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Server.hs rename to typed-protocols/examples/Network/TypedProtocol/ReqResp/Server.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Type.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Type.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/ReqResp/Type.hs rename to typed-protocols/examples/Network/TypedProtocol/ReqResp/Type.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/ReqResp2/Client.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Client.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/ReqResp2/Client.hs rename to typed-protocols/examples/Network/TypedProtocol/ReqResp2/Client.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/ReqResp2/Type.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Type.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/ReqResp2/Type.hs rename to typed-protocols/examples/Network/TypedProtocol/ReqResp2/Type.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/Stateful/ReqResp/Client.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Client.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/Stateful/ReqResp/Client.hs rename to typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Client.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/Stateful/ReqResp/Codec.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Codec.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/Stateful/ReqResp/Codec.hs rename to typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Codec.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/Stateful/ReqResp/Examples.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Examples.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/Stateful/ReqResp/Examples.hs rename to typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Examples.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/Stateful/ReqResp/Server.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Server.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/Stateful/ReqResp/Server.hs rename to typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Server.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/Stateful/ReqResp/Type.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Type.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/Stateful/ReqResp/Type.hs rename to typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Type.hs diff --git a/typed-protocols-examples/src/Network/TypedProtocol/Trans/Wedge.hs b/typed-protocols/examples/Network/TypedProtocol/Trans/Wedge.hs similarity index 100% rename from typed-protocols-examples/src/Network/TypedProtocol/Trans/Wedge.hs rename to typed-protocols/examples/Network/TypedProtocol/Trans/Wedge.hs diff --git a/typed-protocols-stateful-cborg/src/Network/TypedProtocol/Stateful/Codec/CBOR.hs b/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs similarity index 100% rename from typed-protocols-stateful-cborg/src/Network/TypedProtocol/Stateful/Codec/CBOR.hs rename to typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs diff --git a/typed-protocols-stateful/src/Network/TypedProtocol.hs b/typed-protocols/stateful/Network/TypedProtocol.hs similarity index 100% rename from typed-protocols-stateful/src/Network/TypedProtocol.hs rename to typed-protocols/stateful/Network/TypedProtocol.hs diff --git a/typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Codec.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs similarity index 100% rename from typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Codec.hs rename to typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs diff --git a/typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Driver.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs similarity index 100% rename from typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Driver.hs rename to typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs diff --git a/typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Peer.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs similarity index 100% rename from typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Peer.hs rename to typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs diff --git a/typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Peer/Client.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Client.hs similarity index 100% rename from typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Peer/Client.hs rename to typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Client.hs diff --git a/typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Peer/Server.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Server.hs similarity index 100% rename from typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Peer/Server.hs rename to typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Server.hs diff --git a/typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Proofs.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs similarity index 100% rename from typed-protocols-stateful/src/Network/TypedProtocol/Stateful/Proofs.hs rename to typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs diff --git a/typed-protocols-examples/test/Main.hs b/typed-protocols/test/Main.hs similarity index 100% rename from typed-protocols-examples/test/Main.hs rename to typed-protocols/test/Main.hs diff --git a/typed-protocols-examples/test/Network/TypedProtocol/PingPong/Tests.hs b/typed-protocols/test/Network/TypedProtocol/PingPong/Tests.hs similarity index 100% rename from typed-protocols-examples/test/Network/TypedProtocol/PingPong/Tests.hs rename to typed-protocols/test/Network/TypedProtocol/PingPong/Tests.hs diff --git a/typed-protocols-examples/test/Network/TypedProtocol/ReqResp/Tests.hs b/typed-protocols/test/Network/TypedProtocol/ReqResp/Tests.hs similarity index 100% rename from typed-protocols-examples/test/Network/TypedProtocol/ReqResp/Tests.hs rename to typed-protocols/test/Network/TypedProtocol/ReqResp/Tests.hs diff --git a/typed-protocols/typed-protocols.cabal b/typed-protocols/typed-protocols.cabal index 5fb28990..2d30cab6 100644 --- a/typed-protocols/typed-protocols.cabal +++ b/typed-protocols/typed-protocols.cabal @@ -48,3 +48,172 @@ library -Wpartial-fields -Widentities -Wredundant-constraints + +library cborg + visibility: public + exposed-modules: Network.TypedProtocol.Codec.CBOR + + build-depends: base >=4.12 && <4.22, + bytestring >=0.10 && <0.13, + cborg >=0.2.1 && <0.3, + singletons, + primitive, + + io-classes:io-classes ^>= 1.7, + typed-protocols:typed-protocols + + hs-source-dirs: cborg + default-language: Haskell2010 + ghc-options: -Wall + -Wno-unticked-promoted-constructors + -Wcompat + -Wincomplete-uni-patterns + -Wincomplete-record-updates + -Wpartial-fields + -Widentities + -Wredundant-constraints + +library stateful + visibility: public + exposed-modules: Network.TypedProtocol.Stateful.Peer + , Network.TypedProtocol.Stateful.Peer.Client + , Network.TypedProtocol.Stateful.Peer.Server + , Network.TypedProtocol.Stateful.Driver + , Network.TypedProtocol.Stateful.Proofs + , Network.TypedProtocol.Stateful.Codec + + other-extensions: GADTs + , RankNTypes + , PolyKinds + , DataKinds + , ScopedTypeVariables + , TypeFamilies + , TypeOperators + , BangPatterns + default-extensions: ImportQualifiedPost + build-depends: base, + contra-tracer, + singletons >= 3.0, + io-classes:io-classes, + typed-protocols:typed-protocols + + hs-source-dirs: stateful + default-language: Haskell2010 + ghc-options: -Wall + -Wno-unticked-promoted-constructors + -Wcompat + -Wincomplete-uni-patterns + -Wincomplete-record-updates + -Wpartial-fields + -Widentities + -Wredundant-constraints + +library stateful-cborg + visibility: public + exposed-modules: Network.TypedProtocol.Stateful.Codec.CBOR + + build-depends: base >=4.12 && <4.22, + bytestring >=0.10 && <0.13, + cborg >=0.2.1 && <0.3, + singletons, + + io-classes:io-classes, + typed-protocols:{typed-protocols,cborg,stateful} + + hs-source-dirs: stateful-cborg + default-language: Haskell2010 + default-extensions: ImportQualifiedPost + ghc-options: -Wall + -Wno-unticked-promoted-constructors + -Wcompat + -Wincomplete-uni-patterns + -Wincomplete-record-updates + -Wpartial-fields + -Widentities + -Wredundant-constraints + +library examples + visibility: private + exposed-modules: Network.TypedProtocol.Channel + , Network.TypedProtocol.Driver.Simple + + , Network.TypedProtocol.PingPong.Type + , Network.TypedProtocol.PingPong.Client + , Network.TypedProtocol.PingPong.Server + , Network.TypedProtocol.PingPong.Codec + , Network.TypedProtocol.PingPong.Codec.CBOR + , Network.TypedProtocol.PingPong.Examples + + , Network.TypedProtocol.ReqResp.Type + , Network.TypedProtocol.ReqResp.Client + , Network.TypedProtocol.ReqResp.Server + , Network.TypedProtocol.ReqResp.Codec + , Network.TypedProtocol.ReqResp.Codec.CBOR + , Network.TypedProtocol.ReqResp.Examples + + , Network.TypedProtocol.ReqResp2.Type + , Network.TypedProtocol.ReqResp2.Client + + , Network.TypedProtocol.Stateful.ReqResp.Type + , Network.TypedProtocol.Stateful.ReqResp.Client + , Network.TypedProtocol.Stateful.ReqResp.Server + , Network.TypedProtocol.Stateful.ReqResp.Codec + , Network.TypedProtocol.Stateful.ReqResp.Examples + + , Network.TypedProtocol.Trans.Wedge + other-extensions: GADTs + , RankNTypes + , PolyKinds + , DataKinds + , ScopedTypeVariables + , TypeFamilies + , TypeOperators + , BangPatterns + build-depends: base, + bytestring, + cborg, + serialise, + singletons, + contra-tracer, + io-classes:{io-classes,si-timers}, + network, + time, + typed-protocols:{typed-protocols,cborg,stateful} + + hs-source-dirs: examples + default-language: Haskell2010 + ghc-options: -Wall + -Wno-unticked-promoted-constructors + -Wcompat + -Wincomplete-uni-patterns + -Wincomplete-record-updates + -Wpartial-fields + -Widentities + -Wredundant-constraints + +test-suite test + type: exitcode-stdio-1.0 + main-is: Main.hs + hs-source-dirs: test + other-modules: Network.TypedProtocol.PingPong.Tests + , Network.TypedProtocol.ReqResp.Tests + build-depends: base + , bytestring + , contra-tracer + , typed-protocols:{typed-protocols,cborg,examples} + , io-classes:{io-classes,si-timers} + , io-sim + , QuickCheck + , tasty + , tasty-quickcheck + + if !os(windows) + build-depends: directory + , network + , unix + + default-language: Haskell2010 + ghc-options: -rtsopts + -Wall + -Wno-unticked-promoted-constructors + -Wno-orphans From 3a6dd878621227e0640d3149c8559bd9b9519fe2 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Tue, 27 Aug 2024 18:27:00 +0200 Subject: [PATCH 02/11] GHA: haddocks * Use cabal-head in GHA for building haddocks. * Added prologue. --- .github/workflows/github-page.yml | 8 +++++++- .gitignore | 1 + README.md | 10 ++++++---- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/github-page.yml b/.github/workflows/github-page.yml index bca81aff..3710f9ee 100644 --- a/.github/workflows/github-page.yml +++ b/.github/workflows/github-page.yml @@ -31,6 +31,9 @@ jobs: url: ${{ steps.deployment.outputs.page_url }} steps: + - name: Install pandoc + run: sudo apt install pandoc + - name: Checkout ouroboros-network repository uses: actions/checkout@v4 @@ -54,9 +57,12 @@ jobs: - name: Build plan run: cabal build --dry-run --enable-tests all + - name: Run pandoc + run: pandoc --from=gfm --to=haddock --output=README.haddock README.md + - name: Build Haddock documentation 🔧 run: | - cabal haddock-project --hackage all + cabal haddock-project --prologue=README.haddock --hackage all - name: Upload artifacts uses: actions/upload-pages-artifact@v3 diff --git a/.gitignore b/.gitignore index c33954f5..c61ef96c 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ dist-newstyle/ +README.haddock diff --git a/README.md b/README.md index dadebffb..42b66d1f 100644 --- a/README.md +++ b/README.md @@ -12,16 +12,16 @@ A robust session type framework which supports [protocol pipelining][protocol-pi Public content -------------- -Duncan Coutts (@dcoutts) Haskell eXchange 2019 [talk][haskell-eXchange]. +[Duncan Coutts][dcoutts] Haskell eXchange 2019 [talk][haskell-eXchange]. -Monadic party workshop by Marcin Szamotulski (@coot): +Monadic party workshop by Marcin Szamotulski ([coot]): * [part 1][monadic-party-part-1] * [part 2][monadic-party-part-2] * [part 2][monadic-party-part-3] -Talk at [Haskell Love 2021][haskell-love] by Marcin Szamotulski (@coot), [slides][haskell-love-slides]. +Talk at [Haskell Love 2021][haskell-love] by Marcin Szamotulski ([coot]), [slides][haskell-love-slides]. -An [Agda][typed-protocols-agda] implementation by Marcin Szamotulski (@coot). +An [Agda][typed-protocols-agda] implementation by Marcin Szamotulski ([coot]). [protocol-pipelining]: https://www.wikiwand.com/en/Protocol_pipelining @@ -32,3 +32,5 @@ An [Agda][typed-protocols-agda] implementation by Marcin Szamotulski (@coot). [haskell-love-slides]: https://coot.me/posts/typed-protocols-at-haskell-love.html [haskell-love]: https://www.youtube.com/watch?v=EbK6VAqYh3g [typed-protocols-agda]: https://coot.me/agda/posts.agda.typed-protocols.html +[coot]: https://github.com/coot +[dcoutts]: https://github.com/dcoutts From 6be1f230be636ba69d1a1a3bda2db885a429475b Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Thu, 12 Dec 2024 12:39:28 +0100 Subject: [PATCH 03/11] stylish-haskell changes --- scripts/check-stylish.sh | 4 +-- .../TypedProtocol/Stateful/Codec/CBOR.hs | 32 ++++++++--------- .../Network/TypedProtocol/Stateful/Codec.hs | 36 +++++++++---------- .../Network/TypedProtocol/Stateful/Driver.hs | 10 +++--- .../Network/TypedProtocol/Stateful/Peer.hs | 10 +++--- .../Network/TypedProtocol/Stateful/Proofs.hs | 16 ++++----- 6 files changed, 52 insertions(+), 56 deletions(-) diff --git a/scripts/check-stylish.sh b/scripts/check-stylish.sh index a90a801e..0eee1fab 100755 --- a/scripts/check-stylish.sh +++ b/scripts/check-stylish.sh @@ -5,6 +5,4 @@ export LC_ALL=C.UTF-8 [[ -x '/usr/bin/fd' ]] && FD="fd" || FD="fdfind" -$FD . './typed-protocols' -e hs -E Setup.hs -E Core.hs -X stylish-haskell -c .stylish-haskell.yaml -i -$FD . './typed-protocols-cborg' -e hs -E Setup.hs -X stylish-haskell -c .stylish-haskell.yaml -i -$FD . './typed-protocols-examples' -e hs -E Setup.hs -E Channel.hs -X stylish-haskell -c .stylish-haskell.yaml -i +$FD . './typed-protocols' -e hs -E Setup.hs -E Core.hs -E Channel.hs -X stylish-haskell -c .stylish-haskell.yaml -i diff --git a/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs b/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs index 552dc597..7a7b1548 100644 --- a/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs +++ b/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs @@ -12,22 +12,22 @@ module Network.TypedProtocol.Stateful.Codec.CBOR , mkCodecCborStrictBS ) where -import Control.Monad.Class.MonadST (MonadST (..)) - -import Codec.CBOR.Decoding qualified as CBOR (Decoder) -import Codec.CBOR.Encoding qualified as CBOR (Encoding) -import Codec.CBOR.Read qualified as CBOR -import Codec.CBOR.Write qualified as CBOR -import Data.ByteString qualified as BS -import Data.ByteString.Builder qualified as BS -import Data.ByteString.Builder.Extra qualified as BS -import Data.ByteString.Lazy qualified as LBS -import Data.ByteString.Lazy.Internal qualified as LBS (smallChunkSize) - -import Network.TypedProtocol.Stateful.Codec -import Network.TypedProtocol.Codec.CBOR (DeserialiseFailure, - convertCborDecoderBS, convertCborDecoderLBS) -import Network.TypedProtocol.Core +import Control.Monad.Class.MonadST (MonadST (..)) + +import qualified Codec.CBOR.Decoding as CBOR (Decoder) +import qualified Codec.CBOR.Encoding as CBOR (Encoding) +import qualified Codec.CBOR.Read as CBOR +import qualified Codec.CBOR.Write as CBOR +import qualified Data.ByteString as BS +import qualified Data.ByteString.Builder as BS +import qualified Data.ByteString.Builder.Extra as BS +import qualified Data.ByteString.Lazy as LBS +import qualified Data.ByteString.Lazy.Internal as LBS (smallChunkSize) + +import Network.TypedProtocol.Codec.CBOR (DeserialiseFailure, + convertCborDecoderBS, convertCborDecoderLBS) +import Network.TypedProtocol.Core +import Network.TypedProtocol.Stateful.Codec -- | Construct a 'Codec' for a CBOR based serialisation format, using strict diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs index 33451ac4..b2609164 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs @@ -1,18 +1,18 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE PatternSynonyms #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE QuantifiedConstraints #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeFamilies #-} -{-# LANGUAGE ViewPatterns #-} +{-# LANGUAGE DataKinds #-} +{-# LANGUAGE FlexibleContexts #-} +{-# LANGUAGE FlexibleInstances #-} +{-# LANGUAGE GADTs #-} +{-# LANGUAGE NamedFieldPuns #-} +{-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE PolyKinds #-} +{-# LANGUAGE QuantifiedConstraints #-} +{-# LANGUAGE RankNTypes #-} +{-# LANGUAGE ScopedTypeVariables #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE ViewPatterns #-} -- @UndecidableInstances@ extension is required for defining @Show@ instance of -- @'AnyMessage'@ and @'AnyMessage'@. -{-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableInstances #-} {-# OPTIONS_GHC -Wno-dodgy-imports #-} -- | Stateful codec. This module is intended to be imported qualified. @@ -31,7 +31,7 @@ module Network.TypedProtocol.Stateful.Codec -- ** Related types -- *** SomeMessage , SomeMessage (..) - -- *** StateToken + -- *** StateToken , StateToken , StateTokenI (..) -- *** ActiveState @@ -54,12 +54,12 @@ module Network.TypedProtocol.Stateful.Codec import Data.Kind (Type) import Data.Monoid (All (..)) -import Network.TypedProtocol.Core import Network.TypedProtocol.Codec (CodecFailure (..), - DecodeStep (..), SomeMessage (..), hoistDecodeStep, - isoDecodeStep, mapFailureDecodeStep, runDecoder, - runDecoderPure) + DecodeStep (..), SomeMessage (..), hoistDecodeStep, + isoDecodeStep, mapFailureDecodeStep, runDecoder, + runDecoderPure) import qualified Network.TypedProtocol.Codec as TP hiding (AnyMessageAndAgency) +import Network.TypedProtocol.Core -- | A stateful codec. diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs index 90bdb64a..265cc3ef 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs @@ -22,13 +22,13 @@ module Network.TypedProtocol.Stateful.Driver , DecodeStep (..) ) where -import Control.Monad.Class.MonadSTM +import Control.Monad.Class.MonadSTM -import Data.Kind (Type) +import Data.Kind (Type) -import Network.TypedProtocol.Codec (DecodeStep (..), SomeMessage (..)) -import Network.TypedProtocol.Core -import Network.TypedProtocol.Stateful.Peer +import Network.TypedProtocol.Codec (DecodeStep (..), SomeMessage (..)) +import Network.TypedProtocol.Core +import Network.TypedProtocol.Stateful.Peer data Driver ps (pr :: PeerRole) bytes failure dstate f m = Driver { diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs index f821d69b..959fc7b0 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs @@ -3,9 +3,9 @@ {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} {-# LANGUAGE GADTs #-} +{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE PolyKinds #-} {-# LANGUAGE RankNTypes #-} -{-# LANGUAGE MultiParamTypeClasses #-} {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE StandaloneKindSignatures #-} {-# LANGUAGE TypeOperators #-} @@ -17,13 +17,11 @@ -- __Note__: 'Network.TypedProtocol.Peer.Client.Client' and -- 'Network.TypedProtocol.Peer.Server.Server' patterns are easier to use. -- -module Network.TypedProtocol.Stateful.Peer - ( Peer (..) - ) where +module Network.TypedProtocol.Stateful.Peer (Peer (..)) where -import Data.Kind (Type) +import Data.Kind (Type) -import Network.TypedProtocol.Core as Core +import Network.TypedProtocol.Core as Core -- | A description of a peer that engages in a protocol. diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs index af1b3805..28951bad 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs @@ -22,16 +22,16 @@ module Network.TypedProtocol.Stateful.Proofs , removeState ) where -import Control.Monad.Class.MonadSTM +import Control.Monad.Class.MonadSTM -import Data.Kind (Type) -import Data.Singletons +import Data.Kind (Type) +import Data.Singletons -import Network.TypedProtocol.Core -import Network.TypedProtocol.Stateful.Peer qualified as ST -import Network.TypedProtocol.Peer -import Network.TypedProtocol.Proofs (TerminalStates (..)) -import Network.TypedProtocol.Proofs qualified as TP +import Network.TypedProtocol.Core +import Network.TypedProtocol.Peer +import Network.TypedProtocol.Proofs (TerminalStates (..)) +import qualified Network.TypedProtocol.Proofs as TP +import qualified Network.TypedProtocol.Stateful.Peer as ST From d9c140ef19a5b53120d2ecbef183d278e70e7e45 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Wed, 14 May 2025 16:36:35 +0200 Subject: [PATCH 04/11] Dropped all GHC < 9.6 --- .github/workflows/haskell.yml | 2 +- typed-protocols/typed-protocols.cabal | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/haskell.yml b/.github/workflows/haskell.yml index 69c2d369..6f4bca6d 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.8", "9.10"] + ghc: ["9.6", "9.8", "9.10", "9.12"] os: [ubuntu-latest, macos-latest, windows-latest] env: diff --git a/typed-protocols/typed-protocols.cabal b/typed-protocols/typed-protocols.cabal index 2d30cab6..ffd9383b 100644 --- a/typed-protocols/typed-protocols.cabal +++ b/typed-protocols/typed-protocols.cabal @@ -12,7 +12,7 @@ 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, 9.8, 9.10} +tested-with: GHC == {9.6, 9.8, 9.10, 9.12} extra-doc-files: CHANGELOG.md library From c02ceeb695edd422278a1220a4c0657f64061623 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Thu, 15 May 2025 12:54:00 +0200 Subject: [PATCH 05/11] typed-protocols:stateful: it doesn't depend on contra-tracer --- typed-protocols/typed-protocols.cabal | 1 - 1 file changed, 1 deletion(-) diff --git a/typed-protocols/typed-protocols.cabal b/typed-protocols/typed-protocols.cabal index ffd9383b..2c0ab5dd 100644 --- a/typed-protocols/typed-protocols.cabal +++ b/typed-protocols/typed-protocols.cabal @@ -92,7 +92,6 @@ library stateful , BangPatterns default-extensions: ImportQualifiedPost build-depends: base, - contra-tracer, singletons >= 3.0, io-classes:io-classes, typed-protocols:typed-protocols From e457a3cc5b7eff1aa5528e8e894ef5dd7a707fc6 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Thu, 15 May 2025 12:01:04 +0200 Subject: [PATCH 06/11] Bumped versions: typed-protocols-1.0, typed-protocols-doc-0.2 Also simplified dependency constraints. --- typed-protocols-doc/typed-protocols-doc.cabal | 6 ++---- typed-protocols/typed-protocols.cabal | 14 +++++++------- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/typed-protocols-doc/typed-protocols-doc.cabal b/typed-protocols-doc/typed-protocols-doc.cabal index c157dcd5..fa3f3c57 100644 --- a/typed-protocols-doc/typed-protocols-doc.cabal +++ b/typed-protocols-doc/typed-protocols-doc.cabal @@ -1,6 +1,6 @@ cabal-version: 3.0 name: typed-protocols-doc -version: 0.1.0.0 +version: 0.2.0.0 synopsis: Derive documentation from typed-protocols source code -- description: license: Apache-2.0 @@ -35,7 +35,6 @@ library -- other-modules: -- other-extensions: build-depends: base >=4.14.0.0 && <5 - , aeson >=2.0 && <2.3 , base64-bytestring >=1.2.1.0 && <1.3 , blaze-html >=0.9.1.2 && <0.10 @@ -54,14 +53,13 @@ library , th-abstraction >=0.6.0.0 && <0.8 , time >=1.12 && <1.14 , serdoc-core - , typed-protocols + , typed-protocols ^>= 1.0 hs-source-dirs: src default-language: Haskell2010 executable typed-protocols-doc-demo import: warnings default-language: Haskell2010 - type: exitcode-stdio-1.0 hs-source-dirs: demo main-is: Main.hs other-modules: DemoProtocol diff --git a/typed-protocols/typed-protocols.cabal b/typed-protocols/typed-protocols.cabal index 2c0ab5dd..8d82ac6d 100644 --- a/typed-protocols/typed-protocols.cabal +++ b/typed-protocols/typed-protocols.cabal @@ -1,6 +1,6 @@ cabal-version: 3.4 name: typed-protocols -version: 0.4.0.0 +version: 1.0.0.0 synopsis: A framework for strongly typed protocols -- description: license: Apache-2.0 @@ -34,7 +34,7 @@ library , TypeFamilies , TypeOperators , BangPatterns - build-depends: base, + build-depends: base >=4.12 && <4.22, io-classes:io-classes ^>= 1.7, singletons >= 3.0 @@ -53,7 +53,7 @@ library cborg visibility: public exposed-modules: Network.TypedProtocol.Codec.CBOR - build-depends: base >=4.12 && <4.22, + build-depends: base, bytestring >=0.10 && <0.13, cborg >=0.2.1 && <0.3, singletons, @@ -92,7 +92,7 @@ library stateful , BangPatterns default-extensions: ImportQualifiedPost build-depends: base, - singletons >= 3.0, + singletons, io-classes:io-classes, typed-protocols:typed-protocols @@ -111,9 +111,9 @@ library stateful-cborg visibility: public exposed-modules: Network.TypedProtocol.Stateful.Codec.CBOR - build-depends: base >=4.12 && <4.22, - bytestring >=0.10 && <0.13, - cborg >=0.2.1 && <0.3, + build-depends: base, + bytestring, + cborg, singletons, io-classes:io-classes, From dc9fe8d45d0f28fb8af92bec37c9e4db7de2e634 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Thu, 15 May 2025 12:42:12 +0200 Subject: [PATCH 07/11] typed-protocols: updated cabal and README files --- README.md | 3 +++ typed-protocols-doc/typed-protocols-doc.cabal | 3 ++- typed-protocols/README.md | 1 + typed-protocols/typed-protocols.cabal | 5 +++-- 4 files changed, 9 insertions(+), 3 deletions(-) create mode 120000 typed-protocols/README.md diff --git a/README.md b/README.md index 42b66d1f..c386483a 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,8 @@ typed-protocols A robust session type framework which supports [protocol pipelining][protocol-pipelining]. +Haddocks are published [here][haddocks]. + Public content -------------- @@ -34,3 +36,4 @@ An [Agda][typed-protocols-agda] implementation by Marcin Szamotulski ([coot]). [typed-protocols-agda]: https://coot.me/agda/posts.agda.typed-protocols.html [coot]: https://github.com/coot [dcoutts]: https://github.com/dcoutts +[haddocks]: https://input-output-hk.github.io/typed-protocols diff --git a/typed-protocols-doc/typed-protocols-doc.cabal b/typed-protocols-doc/typed-protocols-doc.cabal index fa3f3c57..a4b5b489 100644 --- a/typed-protocols-doc/typed-protocols-doc.cabal +++ b/typed-protocols-doc/typed-protocols-doc.cabal @@ -2,7 +2,8 @@ cabal-version: 3.0 name: typed-protocols-doc version: 0.2.0.0 synopsis: Derive documentation from typed-protocols source code --- description: +description: Derive documentation for protocols implemented with + [typed-protocols](https://hackage.haskell.org/package/typed-protocols). license: Apache-2.0 license-file: LICENSE author: Tobias Dammers diff --git a/typed-protocols/README.md b/typed-protocols/README.md new file mode 120000 index 00000000..32d46ee8 --- /dev/null +++ b/typed-protocols/README.md @@ -0,0 +1 @@ +../README.md \ No newline at end of file diff --git a/typed-protocols/typed-protocols.cabal b/typed-protocols/typed-protocols.cabal index 8d82ac6d..559499af 100644 --- a/typed-protocols/typed-protocols.cabal +++ b/typed-protocols/typed-protocols.cabal @@ -2,7 +2,7 @@ cabal-version: 3.4 name: typed-protocols version: 1.0.0.0 synopsis: A framework for strongly typed protocols --- description: +description: A robust session type framework which supports protocol pipelining. license: Apache-2.0 license-files: LICENSE @@ -14,6 +14,7 @@ category: Control build-type: Simple tested-with: GHC == {9.6, 9.8, 9.10, 9.12} extra-doc-files: CHANGELOG.md + README.md library exposed-modules: Network.TypedProtocol @@ -36,7 +37,7 @@ library , BangPatterns build-depends: base >=4.12 && <4.22, io-classes:io-classes ^>= 1.7, - singletons >= 3.0 + singletons ^>= 3.0 hs-source-dirs: src default-language: Haskell2010 From 11102a0da13ac5b9a8ac31af43ee45f0c2053649 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Thu, 15 May 2025 13:11:42 +0200 Subject: [PATCH 08/11] typed-protocols:examples: it must be a public library --- typed-protocols/typed-protocols.cabal | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/typed-protocols/typed-protocols.cabal b/typed-protocols/typed-protocols.cabal index 559499af..67939196 100644 --- a/typed-protocols/typed-protocols.cabal +++ b/typed-protocols/typed-protocols.cabal @@ -133,7 +133,7 @@ library stateful-cborg -Wredundant-constraints library examples - visibility: private + visibility: public exposed-modules: Network.TypedProtocol.Channel , Network.TypedProtocol.Driver.Simple From 48ce734d99575caeca8c6f6456cbc9be7d281cdb Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Thu, 15 May 2025 18:29:23 +0200 Subject: [PATCH 09/11] typed-protocols: io-classes-1.8 --- cabal.project | 8 ++++++++ typed-protocols/typed-protocols.cabal | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/cabal.project b/cabal.project index 00a718ec..20a5a27d 100644 --- a/cabal.project +++ b/cabal.project @@ -13,3 +13,11 @@ if impl(ghc >= 9.12) if os(windows) package text flags: -simdutf + +source-repository-package + type: git + location: https://github.com/input-output-hk/io-sim + tag: aef112549bf85d51a03919008b6091af8933e9e2 + --sha256: sha256-yfhBeAYwWktqBAkvXUVdrgBzNvTwAqMKglcjwflMtM4= + subdir: io-classes + io-sim diff --git a/typed-protocols/typed-protocols.cabal b/typed-protocols/typed-protocols.cabal index 67939196..e6167258 100644 --- a/typed-protocols/typed-protocols.cabal +++ b/typed-protocols/typed-protocols.cabal @@ -36,7 +36,7 @@ library , TypeOperators , BangPatterns build-depends: base >=4.12 && <4.22, - io-classes:io-classes ^>= 1.7, + io-classes:io-classes ^>= 1.8, singletons ^>= 3.0 hs-source-dirs: src @@ -60,7 +60,7 @@ library cborg singletons, primitive, - io-classes:io-classes ^>= 1.7, + io-classes:io-classes, typed-protocols:typed-protocols hs-source-dirs: cborg @@ -175,7 +175,7 @@ library examples serialise, singletons, contra-tracer, - io-classes:{io-classes,si-timers}, + io-classes:{io-classes, si-timers}, network, time, typed-protocols:{typed-protocols,cborg,stateful} From 72dbeb4280d076a6614d5b16eb2237d64b356966 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Wed, 25 Sep 2024 09:12:17 +0200 Subject: [PATCH 10/11] typed-protocols: use GHC2021 The goal was to use GHC2024, but that's only supported by `GHC >= 9.10`. Required extensions which are part of GHC2024 are added to `default-extensions`. --- .../Documentation/DefaultMain.hs | 2 - .../TypedProtocol/Documentation/GraphViz.hs | 4 -- .../TypedProtocol/Documentation/Html.hs | 8 --- .../Network/TypedProtocol/Documentation/TH.hs | 2 - .../TypedProtocol/Documentation/Text.hs | 4 -- .../TypedProtocol/Documentation/Types.hs | 2 - typed-protocols-doc/typed-protocols-doc.cabal | 7 +-- .../cborg/Network/TypedProtocol/Codec/CBOR.hs | 8 --- .../examples/Network/TypedProtocol/Channel.hs | 7 +-- .../Network/TypedProtocol/Driver/Simple.hs | 8 --- .../Network/TypedProtocol/PingPong/Client.hs | 6 --- .../Network/TypedProtocol/PingPong/Codec.hs | 7 --- .../TypedProtocol/PingPong/Codec/CBOR.hs | 7 --- .../TypedProtocol/PingPong/Examples.hs | 7 --- .../Network/TypedProtocol/PingPong/Server.hs | 2 - .../Network/TypedProtocol/PingPong/Type.hs | 8 +-- .../Network/TypedProtocol/ReqResp/Client.hs | 6 --- .../Network/TypedProtocol/ReqResp/Codec.hs | 8 --- .../TypedProtocol/ReqResp/Codec/CBOR.hs | 7 --- .../Network/TypedProtocol/ReqResp/Examples.hs | 6 --- .../Network/TypedProtocol/ReqResp/Type.hs | 9 +--- .../Network/TypedProtocol/ReqResp2/Client.hs | 9 ---- .../Network/TypedProtocol/ReqResp2/Type.hs | 7 --- .../TypedProtocol/Stateful/ReqResp/Client.hs | 7 --- .../TypedProtocol/Stateful/ReqResp/Codec.hs | 9 ---- .../Stateful/ReqResp/Examples.hs | 7 --- .../TypedProtocol/Stateful/ReqResp/Server.hs | 8 --- .../TypedProtocol/Stateful/ReqResp/Type.hs | 10 +--- .../Network/TypedProtocol/Trans/Wedge.hs | 16 +----- .../src/Network/TypedProtocol/Codec.hs | 9 ---- .../src/Network/TypedProtocol/Core.hs | 21 ++------ .../src/Network/TypedProtocol/Driver.hs | 11 +--- .../src/Network/TypedProtocol/Lemmas.hs | 7 +-- .../src/Network/TypedProtocol/Peer.hs | 11 +--- .../src/Network/TypedProtocol/Peer/Client.hs | 9 +--- .../src/Network/TypedProtocol/Peer/Server.hs | 10 +--- .../src/Network/TypedProtocol/Proofs.hs | 8 --- .../TypedProtocol/Stateful/Codec/CBOR.hs | 7 --- .../Network/TypedProtocol/Stateful/Codec.hs | 8 --- .../Network/TypedProtocol/Stateful/Driver.hs | 11 ---- .../Network/TypedProtocol/Stateful/Peer.hs | 13 +---- .../TypedProtocol/Stateful/Peer/Client.hs | 9 +--- .../TypedProtocol/Stateful/Peer/Server.hs | 9 +--- .../Network/TypedProtocol/Stateful/Proofs.hs | 9 +--- .../Network/TypedProtocol/PingPong/Tests.hs | 7 +-- .../Network/TypedProtocol/ReqResp/Tests.hs | 11 +--- typed-protocols/typed-protocols.cabal | 51 +++++++------------ 47 files changed, 44 insertions(+), 375 deletions(-) diff --git a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/DefaultMain.hs b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/DefaultMain.hs index a8dfe744..cf283767 100644 --- a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/DefaultMain.hs +++ b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/DefaultMain.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE FlexibleContexts #-} - module Network.TypedProtocol.Documentation.DefaultMain where diff --git a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/GraphViz.hs b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/GraphViz.hs index 0f600523..5a957b8e 100644 --- a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/GraphViz.hs +++ b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/GraphViz.hs @@ -1,8 +1,4 @@ {-# LANGUAGE DataKinds #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE PartialTypeSignatures #-} -{-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE OverloadedStrings #-} module Network.TypedProtocol.Documentation.GraphViz diff --git a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Html.hs b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Html.hs index d21c2c24..c424a75f 100644 --- a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Html.hs +++ b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Html.hs @@ -1,12 +1,4 @@ -{-# LANGUAGE TemplateHaskell #-} -{-# LANGUAGE TypeApplications #-} -{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE PartialTypeSignatures #-} -{-# LANGUAGE FlexibleContexts #-} module Network.TypedProtocol.Documentation.Html where diff --git a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/TH.hs b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/TH.hs index 6c2acffa..0601fa7e 100644 --- a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/TH.hs +++ b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/TH.hs @@ -1,7 +1,5 @@ {-# LANGUAGE CPP #-} -{-# LANGUAGE LambdaCase #-} {-# LANGUAGE TemplateHaskell #-} -{-# LANGUAGE QuasiQuotes #-} module Network.TypedProtocol.Documentation.TH ( describeProtocol diff --git a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Text.hs b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Text.hs index 4d0b4124..fabd04f2 100644 --- a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Text.hs +++ b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Text.hs @@ -1,9 +1,5 @@ {-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE PartialTypeSignatures #-} -{-# LANGUAGE FlexibleContexts #-} module Network.TypedProtocol.Documentation.Text where diff --git a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Types.hs b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Types.hs index 52d742bc..485bc2cf 100644 --- a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Types.hs +++ b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/Types.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE DeriveLift #-} -{-# LANGUAGE DerivingStrategies #-} {-# LANGUAGE OverloadedStrings #-} module Network.TypedProtocol.Documentation.Types diff --git a/typed-protocols-doc/typed-protocols-doc.cabal b/typed-protocols-doc/typed-protocols-doc.cabal index a4b5b489..cc6a5d08 100644 --- a/typed-protocols-doc/typed-protocols-doc.cabal +++ b/typed-protocols-doc/typed-protocols-doc.cabal @@ -56,11 +56,12 @@ library , serdoc-core , typed-protocols ^>= 1.0 hs-source-dirs: src - default-language: Haskell2010 + default-language: GHC2021 + default-extensions: DataKinds executable typed-protocols-doc-demo import: warnings - default-language: Haskell2010 + default-language: GHC2021 hs-source-dirs: demo main-is: Main.hs other-modules: DemoProtocol @@ -75,7 +76,7 @@ executable typed-protocols-doc-demo test-suite typed-protocols-doc-test import: warnings - default-language: Haskell2010 + default-language: GHC2021 type: exitcode-stdio-1.0 hs-source-dirs: test main-is: Main.hs diff --git a/typed-protocols/cborg/Network/TypedProtocol/Codec/CBOR.hs b/typed-protocols/cborg/Network/TypedProtocol/Codec/CBOR.hs index 990960e2..4bfa3ea1 100644 --- a/typed-protocols/cborg/Network/TypedProtocol/Codec/CBOR.hs +++ b/typed-protocols/cborg/Network/TypedProtocol/Codec/CBOR.hs @@ -1,11 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE MonoLocalBinds #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} - module Network.TypedProtocol.Codec.CBOR ( module Network.TypedProtocol.Codec , mkCodecCborLazyBS diff --git a/typed-protocols/examples/Network/TypedProtocol/Channel.hs b/typed-protocols/examples/Network/TypedProtocol/Channel.hs index 3333928a..73bbaa3f 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Channel.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Channel.hs @@ -1,9 +1,4 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeApplications #-} +{-# LANGUAGE CPP #-} module Network.TypedProtocol.Channel ( Channel (..) diff --git a/typed-protocols/examples/Network/TypedProtocol/Driver/Simple.hs b/typed-protocols/examples/Network/TypedProtocol/Driver/Simple.hs index 04a4dcfe..86143246 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Driver/Simple.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Driver/Simple.hs @@ -1,11 +1,3 @@ -{-# LANGUAGE BangPatterns #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} -- @UndecidableInstances@ extensions is required for defining @Show@ instance -- of @'TraceSendRecv'@. diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Client.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Client.hs index b6398428..16817157 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Client.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Client.hs @@ -1,9 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeOperators #-} - module Network.TypedProtocol.PingPong.Client ( -- * Normal client PingPongClient (..) diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec.hs index f825dae7..6752ec70 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec.hs @@ -1,10 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE ScopedTypeVariables #-} - module Network.TypedProtocol.PingPong.Codec where import Network.TypedProtocol.Codec diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec/CBOR.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec/CBOR.hs index 0d674a3b..51c183cc 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec/CBOR.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec/CBOR.hs @@ -1,10 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE ScopedTypeVariables #-} - module Network.TypedProtocol.PingPong.Codec.CBOR where import Control.Monad.Class.MonadST diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Examples.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Examples.hs index efcc6ea8..5cf71c4a 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Examples.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Examples.hs @@ -1,10 +1,3 @@ -{-# LANGUAGE BangPatterns #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeOperators #-} - module Network.TypedProtocol.PingPong.Examples where import Network.TypedProtocol.PingPong.Client diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Server.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Server.hs index 768b9621..5fc1ae14 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Server.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Server.hs @@ -1,5 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE GADTs #-} {-# LANGUAGE RecordWildCards #-} module Network.TypedProtocol.PingPong.Server where diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Type.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Type.hs index 5c8c5534..69166d17 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Type.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Type.hs @@ -1,10 +1,4 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE EmptyCase #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE TypeFamilies #-} - +{-# LANGUAGE TypeFamilies #-} module Network.TypedProtocol.PingPong.Type where diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Client.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Client.hs index 4bb1e6a4..b7418103 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Client.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Client.hs @@ -1,9 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} - module Network.TypedProtocol.ReqResp.Client ( -- * Normal client ReqRespClient (..) diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec.hs index 9152de55..8e8139fa 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec.hs @@ -1,11 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE ScopedTypeVariables #-} - module Network.TypedProtocol.ReqResp.Codec where import Network.TypedProtocol.Codec diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec/CBOR.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec/CBOR.hs index 0f12bb3b..7b2fe325 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec/CBOR.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec/CBOR.hs @@ -1,10 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE ScopedTypeVariables #-} - module Network.TypedProtocol.ReqResp.Codec.CBOR where import Control.Monad.Class.MonadST diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Examples.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Examples.hs index ecfb1932..4ef4f70b 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Examples.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Examples.hs @@ -1,9 +1,3 @@ -{-# LANGUAGE BangPatterns #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE ScopedTypeVariables #-} - module Network.TypedProtocol.ReqResp.Examples where import Network.TypedProtocol.ReqResp.Client diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Type.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Type.hs index bd41a9f5..27c2fb89 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Type.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Type.hs @@ -1,11 +1,4 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE EmptyCase #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE TypeFamilies #-} - +{-# LANGUAGE TypeFamilies #-} module Network.TypedProtocol.ReqResp.Type where diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Client.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Client.hs index aa2fd081..29a32ec5 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Client.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Client.hs @@ -1,12 +1,3 @@ -{-# LANGUAGE BangPatterns #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeApplications #-} - - - module Network.TypedProtocol.ReqResp2.Client where import Network.TypedProtocol.ReqResp2.Type diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Type.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Type.hs index 14a567b0..14320953 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Type.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Type.hs @@ -1,12 +1,5 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE EmptyCase #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TypeFamilies #-} - module Network.TypedProtocol.ReqResp2.Type where import Network.TypedProtocol.Core diff --git a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Client.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Client.hs index e72a724b..d41cacc0 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Client.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Client.hs @@ -1,10 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} - module Network.TypedProtocol.Stateful.ReqResp.Client ( ReqRespClient (..) , reqRespClientPeer diff --git a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Codec.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Codec.hs index 538ffd82..a4c973f6 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Codec.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Codec.hs @@ -1,12 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeOperators #-} - module Network.TypedProtocol.Stateful.ReqResp.Codec where import Data.Kind (Type) diff --git a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Examples.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Examples.hs index 7827e5a8..f6912048 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Examples.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Examples.hs @@ -1,10 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} - module Network.TypedProtocol.Stateful.ReqResp.Examples where import Network.TypedProtocol.Stateful.ReqResp.Server diff --git a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Server.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Server.hs index 680ad2ea..d2b61c76 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Server.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Server.hs @@ -1,11 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE LambdaCase #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} - module Network.TypedProtocol.Stateful.ReqResp.Server ( ReqRespServer (..) , reqRespServerPeer diff --git a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Type.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Type.hs index 31e06339..ae2a9643 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Type.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Type.hs @@ -1,12 +1,4 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE TypeFamilies #-} - +{-# LANGUAGE TypeFamilies #-} -- | An RPC protocol which in which request type determines respond time. -- Unlike in the `Network.TypedProtocol.ReqResp.Type` where `req` and `resp` diff --git a/typed-protocols/examples/Network/TypedProtocol/Trans/Wedge.hs b/typed-protocols/examples/Network/TypedProtocol/Trans/Wedge.hs index 05a628ad..33ce6aab 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Trans/Wedge.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Trans/Wedge.hs @@ -1,17 +1,5 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE InstanceSigs #-} -{-# LANGUAGE KindSignatures #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE TypeApplications #-} -{-# LANGUAGE TypeFamilies #-} -{-# LANGUAGE TypeOperators #-} -{-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE UndecidableInstances #-} module Network.TypedProtocol.Trans.Wedge where diff --git a/typed-protocols/src/Network/TypedProtocol/Codec.hs b/typed-protocols/src/Network/TypedProtocol/Codec.hs index 5b16e98f..6f4102b8 100644 --- a/typed-protocols/src/Network/TypedProtocol/Codec.hs +++ b/typed-protocols/src/Network/TypedProtocol/Codec.hs @@ -1,14 +1,5 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE PatternSynonyms #-} -{-# LANGUAGE PolyKinds #-} {-# LANGUAGE QuantifiedConstraints #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeFamilies #-} -- @UndecidableInstances@ extension is required for defining @Show@ instance of -- @'AnyMessage'@ and @'AnyMessage'@. {-# LANGUAGE UndecidableInstances #-} diff --git a/typed-protocols/src/Network/TypedProtocol/Core.hs b/typed-protocols/src/Network/TypedProtocol/Core.hs index e8314979..110e1bea 100644 --- a/typed-protocols/src/Network/TypedProtocol/Core.hs +++ b/typed-protocols/src/Network/TypedProtocol/Core.hs @@ -1,20 +1,7 @@ -{-# LANGUAGE ConstraintKinds #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE DerivingVia #-} -{-# LANGUAGE EmptyCase #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE PatternSynonyms #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE TypeFamilyDependencies #-} -{-# LANGUAGE TypeOperators #-} -{-# LANGUAGE ViewPatterns #-} +{-# LANGUAGE DerivingVia #-} +{-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE ViewPatterns #-} {-# OPTIONS_HADDOCK show-extensions #-} diff --git a/typed-protocols/src/Network/TypedProtocol/Driver.hs b/typed-protocols/src/Network/TypedProtocol/Driver.hs index b12d66c9..5a2e5e7a 100644 --- a/typed-protocols/src/Network/TypedProtocol/Driver.hs +++ b/typed-protocols/src/Network/TypedProtocol/Driver.hs @@ -1,13 +1,4 @@ -{-# LANGUAGE BangPatterns #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE EmptyCase #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeFamilies #-} -- | Actions for running 'Peer's with a 'Driver' -- diff --git a/typed-protocols/src/Network/TypedProtocol/Lemmas.hs b/typed-protocols/src/Network/TypedProtocol/Lemmas.hs index 20bc5f0a..e1611411 100644 --- a/typed-protocols/src/Network/TypedProtocol/Lemmas.hs +++ b/typed-protocols/src/Network/TypedProtocol/Lemmas.hs @@ -1,9 +1,4 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE EmptyCase #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeFamilies #-} {-# OPTIONS_GHC -Wno-unrecognised-pragmas #-} {-# HLINT ignore "Use camelCase" #-} diff --git a/typed-protocols/src/Network/TypedProtocol/Peer.hs b/typed-protocols/src/Network/TypedProtocol/Peer.hs index d95e55a1..e5846f3c 100644 --- a/typed-protocols/src/Network/TypedProtocol/Peer.hs +++ b/typed-protocols/src/Network/TypedProtocol/Peer.hs @@ -1,13 +1,4 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE DeriveFunctor #-} -{-# LANGUAGE DerivingVia #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE DerivingVia #-} -- | Protocol EDSL. -- diff --git a/typed-protocols/src/Network/TypedProtocol/Peer/Client.hs b/typed-protocols/src/Network/TypedProtocol/Peer/Client.hs index 60c355c4..6519c912 100644 --- a/typed-protocols/src/Network/TypedProtocol/Peer/Client.hs +++ b/typed-protocols/src/Network/TypedProtocol/Peer/Client.hs @@ -1,11 +1,4 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PatternSynonyms #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE PatternSynonyms #-} -- | Bidirectional patterns for @'Peer' ps 'AsClient'@. The advantage of -- these patterns is that they automatically provide the 'ReflRelativeAgency' diff --git a/typed-protocols/src/Network/TypedProtocol/Peer/Server.hs b/typed-protocols/src/Network/TypedProtocol/Peer/Server.hs index 025fbf3f..a7d4a1a8 100644 --- a/typed-protocols/src/Network/TypedProtocol/Peer/Server.hs +++ b/typed-protocols/src/Network/TypedProtocol/Peer/Server.hs @@ -1,11 +1,5 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PatternSynonyms #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE PatternSynonyms #-} +{-# LANGUAGE TypeOperators #-} -- | Bidirectional patterns for @'Peer' ps 'AsServer'@. The advantage of -- these patterns is that they automatically provide the 'ReflRelativeAgency' diff --git a/typed-protocols/src/Network/TypedProtocol/Proofs.hs b/typed-protocols/src/Network/TypedProtocol/Proofs.hs index 69125573..274b8c5c 100644 --- a/typed-protocols/src/Network/TypedProtocol/Proofs.hs +++ b/typed-protocols/src/Network/TypedProtocol/Proofs.hs @@ -1,13 +1,5 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE EmptyCase #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PolyKinds #-} {-# LANGUAGE QuantifiedConstraints #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} -{-# LANGUAGE TypeOperators #-} -- This is already implied by the -Wall in the .cabal file, but lets just be -- completely explicit about it too, since we rely on the completeness diff --git a/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs b/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs index 7a7b1548..40118617 100644 --- a/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs +++ b/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs @@ -1,10 +1,3 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE MonoLocalBinds #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} - module Network.TypedProtocol.Stateful.Codec.CBOR ( module Network.TypedProtocol.Stateful.Codec , DeserialiseFailure diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs index b2609164..4b447a5b 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs @@ -1,13 +1,5 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE NamedFieldPuns #-} {-# LANGUAGE PatternSynonyms #-} -{-# LANGUAGE PolyKinds #-} {-# LANGUAGE QuantifiedConstraints #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE TypeFamilies #-} {-# LANGUAGE ViewPatterns #-} -- @UndecidableInstances@ extension is required for defining @Show@ instance of diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs index 265cc3ef..293478fb 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs @@ -1,14 +1,3 @@ -{-# LANGUAGE BangPatterns #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE TypeOperators #-} - -- | Actions for running 'Peer's with a 'Driver'. This module should be -- imported qualified. -- diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs index 959fc7b0..01192085 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs @@ -1,16 +1,5 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE DeriveFunctor #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE MultiParamTypeClasses #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE StandaloneDeriving #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE TypeOperators #-} -- TODO: the 'Functor' instance of 'Peer' is undecidable -{-# LANGUAGE UndecidableInstances #-} +{-# LANGUAGE UndecidableInstances #-} -- | Protocol stateful EDSL. -- diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Client.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Client.hs index 65eed230..6ea19b69 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Client.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Client.hs @@ -1,11 +1,4 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PatternSynonyms #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE PatternSynonyms #-} -- | Bidirectional patterns for @'Peer' ps 'AsClient'@. The advantage of -- these patterns is that they automatically provide the 'RelativeAgencyEq' diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Server.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Server.hs index 6c865539..5bec9ee4 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Server.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Server.hs @@ -1,11 +1,4 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PatternSynonyms #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE StandaloneKindSignatures #-} -{-# LANGUAGE TypeOperators #-} +{-# LANGUAGE PatternSynonyms #-} -- | Bidirectional patterns for @'Peer' ps 'AsServer'@. The advantage of -- these patterns is that they automatically provide the 'RelativeAgencyEq' diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs index 28951bad..0c6f2c31 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs @@ -1,11 +1,4 @@ -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE RankNTypes #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TypeFamilies #-} - +{-# LANGUAGE TypeFamilies #-} -- This is already implied by the -Wall in the .cabal file, but lets just be -- completely explicit about it too, since we rely on the completeness diff --git a/typed-protocols/test/Network/TypedProtocol/PingPong/Tests.hs b/typed-protocols/test/Network/TypedProtocol/PingPong/Tests.hs index 65dfabaf..12aa5934 100644 --- a/typed-protocols/test/Network/TypedProtocol/PingPong/Tests.hs +++ b/typed-protocols/test/Network/TypedProtocol/PingPong/Tests.hs @@ -1,9 +1,4 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE NamedFieldPuns #-} - +{-# LANGUAGE CPP #-} -- orphaned arbitrary instances {-# OPTIONS_GHC -Wno-orphans #-} diff --git a/typed-protocols/test/Network/TypedProtocol/ReqResp/Tests.hs b/typed-protocols/test/Network/TypedProtocol/ReqResp/Tests.hs index a58c21e0..0dfdf648 100644 --- a/typed-protocols/test/Network/TypedProtocol/ReqResp/Tests.hs +++ b/typed-protocols/test/Network/TypedProtocol/ReqResp/Tests.hs @@ -1,16 +1,7 @@ -{-# LANGUAGE CPP #-} -{-# LANGUAGE DataKinds #-} -{-# LANGUAGE FlexibleInstances #-} -{-# LANGUAGE GADTs #-} -{-# LANGUAGE NamedFieldPuns #-} -{-# LANGUAGE PolyKinds #-} -{-# LANGUAGE ScopedTypeVariables #-} -{-# LANGUAGE TupleSections #-} - +{-# LANGUAGE CPP #-} -- orphaned arbitrary instances {-# OPTIONS_GHC -Wno-orphans #-} - module Network.TypedProtocol.ReqResp.Tests (tests) where import Network.TypedProtocol.Channel diff --git a/typed-protocols/typed-protocols.cabal b/typed-protocols/typed-protocols.cabal index e6167258..5232146f 100644 --- a/typed-protocols/typed-protocols.cabal +++ b/typed-protocols/typed-protocols.cabal @@ -26,21 +26,15 @@ library , Network.TypedProtocol.Driver , Network.TypedProtocol.Proofs other-modules: Network.TypedProtocol.Lemmas - - other-extensions: GADTs - , RankNTypes - , PolyKinds - , DataKinds - , ScopedTypeVariables - , TypeFamilies - , TypeOperators - , BangPatterns build-depends: base >=4.12 && <4.22, io-classes:io-classes ^>= 1.8, singletons ^>= 3.0 hs-source-dirs: src - default-language: Haskell2010 + default-language: GHC2021 + default-extensions: DataKinds + GADTs + LambdaCase ghc-options: -Wall -Wno-unticked-promoted-constructors -Wcompat @@ -64,7 +58,8 @@ library cborg typed-protocols:typed-protocols hs-source-dirs: cborg - default-language: Haskell2010 + default-language: GHC2021 + default-extensions: LambdaCase ghc-options: -Wall -Wno-unticked-promoted-constructors -Wcompat @@ -82,23 +77,16 @@ library stateful , Network.TypedProtocol.Stateful.Driver , Network.TypedProtocol.Stateful.Proofs , Network.TypedProtocol.Stateful.Codec - - other-extensions: GADTs - , RankNTypes - , PolyKinds - , DataKinds - , ScopedTypeVariables - , TypeFamilies - , TypeOperators - , BangPatterns - default-extensions: ImportQualifiedPost build-depends: base, singletons, io-classes:io-classes, typed-protocols:typed-protocols hs-source-dirs: stateful - default-language: Haskell2010 + default-language: GHC2021 + default-extensions: DataKinds + GADTs + ImportQualifiedPost ghc-options: -Wall -Wno-unticked-promoted-constructors -Wcompat @@ -121,7 +109,7 @@ library stateful-cborg typed-protocols:{typed-protocols,cborg,stateful} hs-source-dirs: stateful-cborg - default-language: Haskell2010 + default-language: GHC2021 default-extensions: ImportQualifiedPost ghc-options: -Wall -Wno-unticked-promoted-constructors @@ -161,14 +149,6 @@ library examples , Network.TypedProtocol.Stateful.ReqResp.Examples , Network.TypedProtocol.Trans.Wedge - other-extensions: GADTs - , RankNTypes - , PolyKinds - , DataKinds - , ScopedTypeVariables - , TypeFamilies - , TypeOperators - , BangPatterns build-depends: base, bytestring, cborg, @@ -181,7 +161,10 @@ library examples typed-protocols:{typed-protocols,cborg,stateful} hs-source-dirs: examples - default-language: Haskell2010 + default-language: GHC2021 + default-extensions: DataKinds + GADTs + LambdaCase ghc-options: -Wall -Wno-unticked-promoted-constructors -Wcompat @@ -195,6 +178,9 @@ test-suite test type: exitcode-stdio-1.0 main-is: Main.hs hs-source-dirs: test + default-language: GHC2021 + default-extensions: GADTs + LambdaCase other-modules: Network.TypedProtocol.PingPong.Tests , Network.TypedProtocol.ReqResp.Tests build-depends: base @@ -212,7 +198,6 @@ test-suite test , network , unix - default-language: Haskell2010 ghc-options: -rtsopts -Wall -Wno-unticked-promoted-constructors From cd1e9d6a4d7899fd40966fc14754c243a501a0f9 Mon Sep 17 00:00:00 2001 From: Marcin Szamotulski Date: Wed, 25 Sep 2024 09:16:48 +0200 Subject: [PATCH 11/11] typed-protocols: use ImportQualifiedPost --- .stylish-haskell.yaml | 19 +++++ .../TypedProtocol/Documentation/GraphViz.hs | 1 - typed-protocols-doc/typed-protocols-doc.cabal | 1 + .../cborg/Network/TypedProtocol/Codec/CBOR.hs | 30 ++++---- .../examples/Network/TypedProtocol/Channel.hs | 24 +++---- .../Network/TypedProtocol/Driver/Simple.hs | 18 ++--- .../Network/TypedProtocol/PingPong/Client.hs | 6 +- .../Network/TypedProtocol/PingPong/Codec.hs | 6 +- .../TypedProtocol/PingPong/Codec/CBOR.hs | 18 ++--- .../TypedProtocol/PingPong/Examples.hs | 6 +- .../Network/TypedProtocol/PingPong/Server.hs | 6 +- .../Network/TypedProtocol/PingPong/Type.hs | 2 +- .../Network/TypedProtocol/ReqResp/Client.hs | 10 +-- .../Network/TypedProtocol/ReqResp/Codec.hs | 10 +-- .../TypedProtocol/ReqResp/Codec/CBOR.hs | 32 ++++----- .../Network/TypedProtocol/ReqResp/Examples.hs | 6 +- .../Network/TypedProtocol/ReqResp/Server.hs | 6 +- .../Network/TypedProtocol/ReqResp/Type.hs | 2 +- .../Network/TypedProtocol/ReqResp2/Client.hs | 6 +- .../Network/TypedProtocol/ReqResp2/Type.hs | 4 +- .../TypedProtocol/Stateful/ReqResp/Client.hs | 6 +- .../TypedProtocol/Stateful/ReqResp/Codec.hs | 14 ++-- .../Stateful/ReqResp/Examples.hs | 4 +- .../TypedProtocol/Stateful/ReqResp/Server.hs | 6 +- .../TypedProtocol/Stateful/ReqResp/Type.hs | 6 +- .../Network/TypedProtocol/Trans/Wedge.hs | 6 +- typed-protocols/src/Network/TypedProtocol.hs | 6 +- .../src/Network/TypedProtocol/Codec.hs | 10 +-- .../src/Network/TypedProtocol/Core.hs | 6 +- .../src/Network/TypedProtocol/Driver.hs | 14 ++-- .../src/Network/TypedProtocol/Lemmas.hs | 4 +- .../src/Network/TypedProtocol/Peer.hs | 4 +- .../src/Network/TypedProtocol/Peer/Client.hs | 8 +-- .../src/Network/TypedProtocol/Peer/Server.hs | 8 +-- .../src/Network/TypedProtocol/Proofs.hs | 8 +-- .../TypedProtocol/Stateful/Codec/CBOR.hs | 32 ++++----- .../stateful/Network/TypedProtocol.hs | 6 +- .../Network/TypedProtocol/Stateful/Codec.hs | 15 ++-- .../Network/TypedProtocol/Stateful/Driver.hs | 10 +-- .../Network/TypedProtocol/Stateful/Peer.hs | 4 +- .../TypedProtocol/Stateful/Peer/Client.hs | 8 +-- .../TypedProtocol/Stateful/Peer/Server.hs | 8 +-- .../Network/TypedProtocol/Stateful/Proofs.hs | 16 ++--- typed-protocols/test/Main.hs | 6 +- .../Network/TypedProtocol/PingPong/Tests.hs | 54 +++++++------- .../Network/TypedProtocol/ReqResp/Tests.hs | 72 +++++++++---------- 46 files changed, 286 insertions(+), 268 deletions(-) diff --git a/.stylish-haskell.yaml b/.stylish-haskell.yaml index 036a8905..887cd8da 100644 --- a/.stylish-haskell.yaml +++ b/.stylish-haskell.yaml @@ -191,6 +191,25 @@ steps: # Default: false space_surround: false + # Post qualify option moves any qualifies found in import declarations + # to the end of the declaration. This also adjust padding for any + # unqualified import declarations. + # + # - true: Qualified as is moved to the end of the + # declaration. + # + # > import Data.Bar + # > import Data.Foo qualified as F + # + # - false: Qualified remains in the default location and unqualified + # imports are padded to align with qualified imports. + # + # > import Data.Bar + # > import qualified Data.Foo as F + # + # Default: false + post_qualify: true + # Language pragmas - language_pragmas: # We can generate different styles of language pragma lists. diff --git a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/GraphViz.hs b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/GraphViz.hs index 5a957b8e..4f144326 100644 --- a/typed-protocols-doc/src/Network/TypedProtocol/Documentation/GraphViz.hs +++ b/typed-protocols-doc/src/Network/TypedProtocol/Documentation/GraphViz.hs @@ -1,4 +1,3 @@ -{-# LANGUAGE DataKinds #-} {-# LANGUAGE OverloadedStrings #-} module Network.TypedProtocol.Documentation.GraphViz diff --git a/typed-protocols-doc/typed-protocols-doc.cabal b/typed-protocols-doc/typed-protocols-doc.cabal index cc6a5d08..373d50df 100644 --- a/typed-protocols-doc/typed-protocols-doc.cabal +++ b/typed-protocols-doc/typed-protocols-doc.cabal @@ -58,6 +58,7 @@ library hs-source-dirs: src default-language: GHC2021 default-extensions: DataKinds + LambdaCase executable typed-protocols-doc-demo import: warnings diff --git a/typed-protocols/cborg/Network/TypedProtocol/Codec/CBOR.hs b/typed-protocols/cborg/Network/TypedProtocol/Codec/CBOR.hs index 4bfa3ea1..a0ff3a21 100644 --- a/typed-protocols/cborg/Network/TypedProtocol/Codec/CBOR.hs +++ b/typed-protocols/cborg/Network/TypedProtocol/Codec/CBOR.hs @@ -8,21 +8,21 @@ module Network.TypedProtocol.Codec.CBOR , CBOR.DeserialiseFailure (..) ) where -import Control.Monad.Class.MonadST (MonadST (..)) -import Control.Monad.ST hiding (stToIO) - -import qualified Codec.CBOR.Decoding as CBOR (Decoder) -import qualified Codec.CBOR.Encoding as CBOR (Encoding) -import qualified Codec.CBOR.Read as CBOR -import qualified Codec.CBOR.Write as CBOR -import qualified Data.ByteString as BS -import qualified Data.ByteString.Builder as BS -import qualified Data.ByteString.Builder.Extra as BS -import qualified Data.ByteString.Lazy as LBS -import qualified Data.ByteString.Lazy.Internal as LBS (smallChunkSize) - -import Network.TypedProtocol.Codec -import Network.TypedProtocol.Core +import Control.Monad.Class.MonadST (MonadST (..)) +import Control.Monad.ST hiding (stToIO) + +import Codec.CBOR.Decoding qualified as CBOR (Decoder) +import Codec.CBOR.Encoding qualified as CBOR (Encoding) +import Codec.CBOR.Read qualified as CBOR +import Codec.CBOR.Write qualified as CBOR +import Data.ByteString qualified as BS +import Data.ByteString.Builder qualified as BS +import Data.ByteString.Builder.Extra qualified as BS +import Data.ByteString.Lazy qualified as LBS +import Data.ByteString.Lazy.Internal qualified as LBS (smallChunkSize) + +import Network.TypedProtocol.Codec +import Network.TypedProtocol.Core -- | Construct a 'Codec' for a CBOR based serialisation format, using strict diff --git a/typed-protocols/examples/Network/TypedProtocol/Channel.hs b/typed-protocols/examples/Network/TypedProtocol/Channel.hs index 73bbaa3f..a53670e7 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Channel.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Channel.hs @@ -19,22 +19,22 @@ module Network.TypedProtocol.Channel , loggingChannel ) where -import Control.Concurrent.Class.MonadSTM -import Control.Monad ((>=>)) -import Control.Monad.Class.MonadSay -import Control.Monad.Class.MonadTimer.SI -import qualified Data.ByteString as BS -import qualified Data.ByteString.Lazy as LBS -import Data.ByteString.Lazy.Internal (smallChunkSize) -import Data.Proxy -import Numeric.Natural +import Control.Concurrent.Class.MonadSTM +import Control.Monad ((>=>)) +import Control.Monad.Class.MonadSay +import Control.Monad.Class.MonadTimer.SI +import Data.ByteString qualified as BS +import Data.ByteString.Lazy qualified as LBS +import Data.ByteString.Lazy.Internal (smallChunkSize) +import Data.Proxy +import Numeric.Natural #if !defined(mingw32_HOST_OS) -import Network.Socket (Socket) -import qualified Network.Socket.ByteString.Lazy as Socket +import Network.Socket (Socket) +import Network.Socket.ByteString.Lazy qualified as Socket #endif -import qualified System.IO as IO (Handle, hFlush, hIsEOF) +import System.IO qualified as IO (Handle, hFlush, hIsEOF) -- | One end of a duplex channel. It is a reliable, ordered channel of some diff --git a/typed-protocols/examples/Network/TypedProtocol/Driver/Simple.hs b/typed-protocols/examples/Network/TypedProtocol/Driver/Simple.hs index 86143246..93e18233 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Driver/Simple.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Driver/Simple.hs @@ -24,15 +24,15 @@ module Network.TypedProtocol.Driver.Simple , runDecoderWithChannel ) where -import Network.TypedProtocol.Channel -import Network.TypedProtocol.Codec -import Network.TypedProtocol.Core -import Network.TypedProtocol.Driver -import Network.TypedProtocol.Peer - -import Control.Monad.Class.MonadAsync -import Control.Monad.Class.MonadThrow -import Control.Tracer (Tracer (..), contramap, traceWith) +import Network.TypedProtocol.Channel +import Network.TypedProtocol.Codec +import Network.TypedProtocol.Core +import Network.TypedProtocol.Driver +import Network.TypedProtocol.Peer + +import Control.Monad.Class.MonadAsync +import Control.Monad.Class.MonadThrow +import Control.Tracer (Tracer (..), contramap, traceWith) -- $intro diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Client.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Client.hs index 16817157..2a68b47d 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Client.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Client.hs @@ -8,9 +8,9 @@ module Network.TypedProtocol.PingPong.Client , pingPongClientPeerPipelined ) where -import Network.TypedProtocol.Core -import Network.TypedProtocol.Peer.Client -import Network.TypedProtocol.PingPong.Type +import Network.TypedProtocol.Core +import Network.TypedProtocol.Peer.Client +import Network.TypedProtocol.PingPong.Type -- | A ping-pong client, on top of some effect 'm'. -- diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec.hs index 6752ec70..405addca 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec.hs @@ -1,8 +1,8 @@ module Network.TypedProtocol.PingPong.Codec where -import Network.TypedProtocol.Codec -import Network.TypedProtocol.Core -import Network.TypedProtocol.PingPong.Type +import Network.TypedProtocol.Codec +import Network.TypedProtocol.Core +import Network.TypedProtocol.PingPong.Type codecPingPong diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec/CBOR.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec/CBOR.hs index 51c183cc..6dd0499b 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec/CBOR.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Codec/CBOR.hs @@ -1,17 +1,17 @@ module Network.TypedProtocol.PingPong.Codec.CBOR where -import Control.Monad.Class.MonadST +import Control.Monad.Class.MonadST -import Data.ByteString.Lazy (ByteString) +import Data.ByteString.Lazy (ByteString) -import qualified Codec.CBOR.Decoding as CBOR (Decoder, decodeWord) -import qualified Codec.CBOR.Encoding as CBOR (Encoding, encodeWord) -import qualified Codec.CBOR.Read as CBOR +import Codec.CBOR.Decoding qualified as CBOR (Decoder, decodeWord) +import Codec.CBOR.Encoding qualified as CBOR (Encoding, encodeWord) +import Codec.CBOR.Read qualified as CBOR -import Network.TypedProtocol.Codec -import Network.TypedProtocol.Codec.CBOR -import Network.TypedProtocol.Core -import Network.TypedProtocol.PingPong.Type +import Network.TypedProtocol.Codec +import Network.TypedProtocol.Codec.CBOR +import Network.TypedProtocol.Core +import Network.TypedProtocol.PingPong.Type codecPingPong :: forall m. diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Examples.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Examples.hs index 5cf71c4a..2aa2bf12 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Examples.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Examples.hs @@ -1,9 +1,9 @@ module Network.TypedProtocol.PingPong.Examples where -import Network.TypedProtocol.PingPong.Client -import Network.TypedProtocol.PingPong.Server +import Network.TypedProtocol.PingPong.Client +import Network.TypedProtocol.PingPong.Server -import Network.TypedProtocol.Peer.Client +import Network.TypedProtocol.Peer.Client -- | The standard stateless ping-pong server instance. diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Server.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Server.hs index 5fc1ae14..58696293 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Server.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Server.hs @@ -2,9 +2,9 @@ module Network.TypedProtocol.PingPong.Server where -import Network.TypedProtocol.Core -import Network.TypedProtocol.Peer.Server -import Network.TypedProtocol.PingPong.Type +import Network.TypedProtocol.Core +import Network.TypedProtocol.Peer.Server +import Network.TypedProtocol.PingPong.Type data PingPongServer m a = PingPongServer { diff --git a/typed-protocols/examples/Network/TypedProtocol/PingPong/Type.hs b/typed-protocols/examples/Network/TypedProtocol/PingPong/Type.hs index 69166d17..a606dcb0 100644 --- a/typed-protocols/examples/Network/TypedProtocol/PingPong/Type.hs +++ b/typed-protocols/examples/Network/TypedProtocol/PingPong/Type.hs @@ -2,7 +2,7 @@ module Network.TypedProtocol.PingPong.Type where -import Network.TypedProtocol.Core +import Network.TypedProtocol.Core -- | The ping\/pong protocol and the states in its protocol state machine. diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Client.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Client.hs index b7418103..81d93075 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Client.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Client.hs @@ -11,11 +11,11 @@ module Network.TypedProtocol.ReqResp.Client , requestOnce ) where -import Network.TypedProtocol.Core -import Network.TypedProtocol.Peer.Client -import Network.TypedProtocol.Peer.Server (Server) -import Network.TypedProtocol.Proofs (connect) -import Network.TypedProtocol.ReqResp.Type +import Network.TypedProtocol.Core +import Network.TypedProtocol.Peer.Client +import Network.TypedProtocol.Peer.Server (Server) +import Network.TypedProtocol.Proofs (connect) +import Network.TypedProtocol.ReqResp.Type data ReqRespClient req resp m a where SendMsgReq :: req diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec.hs index 8e8139fa..ae614278 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec.hs @@ -1,10 +1,10 @@ module Network.TypedProtocol.ReqResp.Codec where -import Network.TypedProtocol.Codec -import Network.TypedProtocol.Core -import Network.TypedProtocol.PingPong.Codec (decodeTerminatedFrame) -import Network.TypedProtocol.ReqResp.Type -import Text.Read (readMaybe) +import Network.TypedProtocol.Codec +import Network.TypedProtocol.Core +import Network.TypedProtocol.PingPong.Codec (decodeTerminatedFrame) +import Network.TypedProtocol.ReqResp.Type +import Text.Read (readMaybe) codecReqResp :: diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec/CBOR.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec/CBOR.hs index 7b2fe325..18935eee 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec/CBOR.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Codec/CBOR.hs @@ -1,21 +1,21 @@ module Network.TypedProtocol.ReqResp.Codec.CBOR where -import Control.Monad.Class.MonadST - -import Data.ByteString.Lazy (ByteString) - -import qualified Codec.CBOR.Decoding as CBOR (Decoder, decodeListLen, - decodeWord) -import qualified Codec.CBOR.Encoding as CBOR (Encoding, encodeListLen, - encodeWord) -import qualified Codec.CBOR.Read as CBOR -import Codec.Serialise.Class (Serialise) -import qualified Codec.Serialise.Class as CBOR - -import Network.TypedProtocol.Codec -import Network.TypedProtocol.Codec.CBOR -import Network.TypedProtocol.Core -import Network.TypedProtocol.ReqResp.Type +import Control.Monad.Class.MonadST + +import Data.ByteString.Lazy (ByteString) + +import Codec.CBOR.Decoding qualified as CBOR (Decoder, decodeListLen, + decodeWord) +import Codec.CBOR.Encoding qualified as CBOR (Encoding, encodeListLen, + encodeWord) +import Codec.CBOR.Read qualified as CBOR +import Codec.Serialise.Class (Serialise) +import Codec.Serialise.Class qualified as CBOR + +import Network.TypedProtocol.Codec +import Network.TypedProtocol.Codec.CBOR +import Network.TypedProtocol.Core +import Network.TypedProtocol.ReqResp.Type codecReqResp :: forall req resp m. diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Examples.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Examples.hs index 4ef4f70b..2b7706ac 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Examples.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Examples.hs @@ -1,9 +1,9 @@ module Network.TypedProtocol.ReqResp.Examples where -import Network.TypedProtocol.ReqResp.Client -import Network.TypedProtocol.ReqResp.Server +import Network.TypedProtocol.ReqResp.Client +import Network.TypedProtocol.ReqResp.Server -import Network.TypedProtocol.Peer.Client +import Network.TypedProtocol.Peer.Client -- | An example request\/response client which ignores received responses. -- diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Server.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Server.hs index dcb91806..1d8127c1 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Server.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Server.hs @@ -4,9 +4,9 @@ module Network.TypedProtocol.ReqResp.Server where -import Network.TypedProtocol.Core -import Network.TypedProtocol.Peer.Server -import Network.TypedProtocol.ReqResp.Type +import Network.TypedProtocol.Core +import Network.TypedProtocol.Peer.Server +import Network.TypedProtocol.ReqResp.Type data ReqRespServer req resp m a = ReqRespServer { diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Type.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Type.hs index 27c2fb89..69df3221 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp/Type.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp/Type.hs @@ -2,7 +2,7 @@ module Network.TypedProtocol.ReqResp.Type where -import Network.TypedProtocol.Core +import Network.TypedProtocol.Core data ReqResp req resp where diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Client.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Client.hs index 29a32ec5..ff6beb8a 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Client.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Client.hs @@ -1,9 +1,9 @@ module Network.TypedProtocol.ReqResp2.Client where -import Network.TypedProtocol.ReqResp2.Type +import Network.TypedProtocol.ReqResp2.Type -import Network.TypedProtocol.Core -import Network.TypedProtocol.Peer.Client +import Network.TypedProtocol.Core +import Network.TypedProtocol.Peer.Client reqResp2Client :: forall req resp m. diff --git a/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Type.hs b/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Type.hs index 14320953..706b05ef 100644 --- a/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Type.hs +++ b/typed-protocols/examples/Network/TypedProtocol/ReqResp2/Type.hs @@ -1,8 +1,8 @@ -{-# LANGUAGE TypeFamilies #-} +{-# LANGUAGE TypeFamilies #-} module Network.TypedProtocol.ReqResp2.Type where -import Network.TypedProtocol.Core +import Network.TypedProtocol.Core data ReqResp2 req resp where diff --git a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Client.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Client.hs index d41cacc0..e5160947 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Client.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Client.hs @@ -3,9 +3,9 @@ module Network.TypedProtocol.Stateful.ReqResp.Client , reqRespClientPeer ) where -import Data.Typeable -import Network.TypedProtocol.Stateful.Peer.Client -import Network.TypedProtocol.Stateful.ReqResp.Type +import Data.Typeable +import Network.TypedProtocol.Stateful.Peer.Client +import Network.TypedProtocol.Stateful.ReqResp.Type data ReqRespClient req m a where SendMsgReq :: Typeable resp diff --git a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Codec.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Codec.hs index a4c973f6..fb1ff8fb 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Codec.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Codec.hs @@ -1,12 +1,12 @@ module Network.TypedProtocol.Stateful.ReqResp.Codec where -import Data.Kind (Type) -import Data.Singletons.Decide -import Data.Typeable -import Network.TypedProtocol.Core -import Network.TypedProtocol.PingPong.Codec (decodeTerminatedFrame) -import Network.TypedProtocol.Stateful.Codec -import Network.TypedProtocol.Stateful.ReqResp.Type +import Data.Kind (Type) +import Data.Singletons.Decide +import Data.Typeable +import Network.TypedProtocol.Core +import Network.TypedProtocol.PingPong.Codec (decodeTerminatedFrame) +import Network.TypedProtocol.Stateful.Codec +import Network.TypedProtocol.Stateful.ReqResp.Type data Some (f :: k -> Type) where Some :: Typeable a => f a -> Some f diff --git a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Examples.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Examples.hs index f6912048..817c712e 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Examples.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Examples.hs @@ -1,7 +1,7 @@ module Network.TypedProtocol.Stateful.ReqResp.Examples where -import Network.TypedProtocol.Stateful.ReqResp.Server -import Network.TypedProtocol.Stateful.ReqResp.Type +import Network.TypedProtocol.Stateful.ReqResp.Server +import Network.TypedProtocol.Stateful.ReqResp.Type fileRPCServer :: Monad m diff --git a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Server.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Server.hs index d2b61c76..91a12fa2 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Server.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Server.hs @@ -3,9 +3,9 @@ module Network.TypedProtocol.Stateful.ReqResp.Server , reqRespServerPeer ) where -import Data.Typeable -import Network.TypedProtocol.Stateful.Peer.Server -import Network.TypedProtocol.Stateful.ReqResp.Type +import Data.Typeable +import Network.TypedProtocol.Stateful.Peer.Server +import Network.TypedProtocol.Stateful.ReqResp.Type data ReqRespServer req m a = ReqRespServer { diff --git a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Type.hs b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Type.hs index ae2a9643..cb22bfad 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Type.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Stateful/ReqResp/Type.hs @@ -7,9 +7,9 @@ -- module Network.TypedProtocol.Stateful.ReqResp.Type where -import Data.Kind (Type) -import Data.Typeable -import Network.TypedProtocol.Core +import Data.Kind (Type) +import Data.Typeable +import Network.TypedProtocol.Core type ReqResp :: (Type -> Type) -> Type diff --git a/typed-protocols/examples/Network/TypedProtocol/Trans/Wedge.hs b/typed-protocols/examples/Network/TypedProtocol/Trans/Wedge.hs index 33ce6aab..648964dc 100644 --- a/typed-protocols/examples/Network/TypedProtocol/Trans/Wedge.hs +++ b/typed-protocols/examples/Network/TypedProtocol/Trans/Wedge.hs @@ -3,10 +3,10 @@ module Network.TypedProtocol.Trans.Wedge where -import Network.TypedProtocol.Core +import Network.TypedProtocol.Core -import qualified Network.TypedProtocol.Peer.Client as Client -import qualified Network.TypedProtocol.PingPong.Type as PingPong +import Network.TypedProtocol.Peer.Client qualified as Client +import Network.TypedProtocol.PingPong.Type qualified as PingPong -- | A [wedge](https://hackage.haskell.org/package/smash-0.1.2/docs/Data-Wedge.html) diff --git a/typed-protocols/src/Network/TypedProtocol.hs b/typed-protocols/src/Network/TypedProtocol.hs index b79a0aec..5f0d716d 100644 --- a/typed-protocols/src/Network/TypedProtocol.hs +++ b/typed-protocols/src/Network/TypedProtocol.hs @@ -16,9 +16,9 @@ module Network.TypedProtocol , module Network.TypedProtocol.Driver ) where -import Network.TypedProtocol.Core -import Network.TypedProtocol.Driver -import Network.TypedProtocol.Proofs +import Network.TypedProtocol.Core +import Network.TypedProtocol.Driver +import Network.TypedProtocol.Proofs -- $intro diff --git a/typed-protocols/src/Network/TypedProtocol/Codec.hs b/typed-protocols/src/Network/TypedProtocol/Codec.hs index 6f4102b8..8c259ee5 100644 --- a/typed-protocols/src/Network/TypedProtocol/Codec.hs +++ b/typed-protocols/src/Network/TypedProtocol/Codec.hs @@ -48,12 +48,12 @@ module Network.TypedProtocol.Codec , SomeState (..) ) where -import Control.Exception (Exception) -import Data.Kind (Type) -import Data.Monoid (All (..)) +import Control.Exception (Exception) +import Data.Kind (Type) +import Data.Monoid (All (..)) -import Network.TypedProtocol.Core -import Network.TypedProtocol.Driver (SomeMessage (..)) +import Network.TypedProtocol.Core +import Network.TypedProtocol.Driver (SomeMessage (..)) -- | A codec for a 'Protocol' handles the encoding and decoding of typed diff --git a/typed-protocols/src/Network/TypedProtocol/Core.hs b/typed-protocols/src/Network/TypedProtocol/Core.hs index 110e1bea..3fdbb9b3 100644 --- a/typed-protocols/src/Network/TypedProtocol/Core.hs +++ b/typed-protocols/src/Network/TypedProtocol/Core.hs @@ -51,10 +51,10 @@ module Network.TypedProtocol.Core , unsafeIntToNat ) where -import Data.Kind (Constraint, Type) -import Unsafe.Coerce (unsafeCoerce) +import Data.Kind (Constraint, Type) +import Unsafe.Coerce (unsafeCoerce) -import Data.Singletons +import Data.Singletons -- $intro -- A typed protocol between two peers is defined via a state machine: a diff --git a/typed-protocols/src/Network/TypedProtocol/Driver.hs b/typed-protocols/src/Network/TypedProtocol/Driver.hs index 5a2e5e7a..607d641d 100644 --- a/typed-protocols/src/Network/TypedProtocol/Driver.hs +++ b/typed-protocols/src/Network/TypedProtocol/Driver.hs @@ -14,15 +14,15 @@ module Network.TypedProtocol.Driver , runPipelinedPeerWithDriver ) where -import Data.Void (Void) +import Data.Void (Void) -import Network.TypedProtocol.Core -import Network.TypedProtocol.Peer +import Network.TypedProtocol.Core +import Network.TypedProtocol.Peer -import Control.Concurrent.Class.MonadSTM.TQueue -import Control.Monad.Class.MonadAsync -import Control.Monad.Class.MonadFork -import Control.Monad.Class.MonadSTM +import Control.Concurrent.Class.MonadSTM.TQueue +import Control.Monad.Class.MonadAsync +import Control.Monad.Class.MonadFork +import Control.Monad.Class.MonadSTM -- $intro diff --git a/typed-protocols/src/Network/TypedProtocol/Lemmas.hs b/typed-protocols/src/Network/TypedProtocol/Lemmas.hs index e1611411..3e55771f 100644 --- a/typed-protocols/src/Network/TypedProtocol/Lemmas.hs +++ b/typed-protocols/src/Network/TypedProtocol/Lemmas.hs @@ -11,8 +11,8 @@ -- module Network.TypedProtocol.Lemmas where -import Data.Kind (Type) -import Network.TypedProtocol.Core +import Data.Kind (Type) +import Network.TypedProtocol.Core -- $about diff --git a/typed-protocols/src/Network/TypedProtocol/Peer.hs b/typed-protocols/src/Network/TypedProtocol/Peer.hs index e5846f3c..d2ceec2c 100644 --- a/typed-protocols/src/Network/TypedProtocol/Peer.hs +++ b/typed-protocols/src/Network/TypedProtocol/Peer.hs @@ -13,9 +13,9 @@ module Network.TypedProtocol.Peer , unsafeIntToNat ) where -import Data.Kind (Type) +import Data.Kind (Type) -import Network.TypedProtocol.Core as Core +import Network.TypedProtocol.Core as Core -- | A description of a peer that engages in a protocol. -- diff --git a/typed-protocols/src/Network/TypedProtocol/Peer/Client.hs b/typed-protocols/src/Network/TypedProtocol/Peer/Client.hs index 6519c912..c77c15d4 100644 --- a/typed-protocols/src/Network/TypedProtocol/Peer/Client.hs +++ b/typed-protocols/src/Network/TypedProtocol/Peer/Client.hs @@ -28,11 +28,11 @@ module Network.TypedProtocol.Peer.Client , Nat (..) ) where -import Data.Kind (Type) +import Data.Kind (Type) -import Network.TypedProtocol.Core -import Network.TypedProtocol.Peer (Peer) -import qualified Network.TypedProtocol.Peer as TP +import Network.TypedProtocol.Core +import Network.TypedProtocol.Peer (Peer) +import Network.TypedProtocol.Peer qualified as TP type Client :: forall ps diff --git a/typed-protocols/src/Network/TypedProtocol/Peer/Server.hs b/typed-protocols/src/Network/TypedProtocol/Peer/Server.hs index a7d4a1a8..67c45623 100644 --- a/typed-protocols/src/Network/TypedProtocol/Peer/Server.hs +++ b/typed-protocols/src/Network/TypedProtocol/Peer/Server.hs @@ -29,11 +29,11 @@ module Network.TypedProtocol.Peer.Server , Nat (..) ) where -import Data.Kind (Type) +import Data.Kind (Type) -import Network.TypedProtocol.Core -import Network.TypedProtocol.Peer (Peer) -import qualified Network.TypedProtocol.Peer as TP +import Network.TypedProtocol.Core +import Network.TypedProtocol.Peer (Peer) +import Network.TypedProtocol.Peer qualified as TP type Server :: forall ps diff --git a/typed-protocols/src/Network/TypedProtocol/Proofs.hs b/typed-protocols/src/Network/TypedProtocol/Proofs.hs index 274b8c5c..4f70c86a 100644 --- a/typed-protocols/src/Network/TypedProtocol/Proofs.hs +++ b/typed-protocols/src/Network/TypedProtocol/Proofs.hs @@ -24,10 +24,10 @@ module Network.TypedProtocol.Proofs , pipelineInterleaving ) where -import Data.Singletons -import Network.TypedProtocol.Core -import Network.TypedProtocol.Lemmas -import Network.TypedProtocol.Peer +import Data.Singletons +import Network.TypedProtocol.Core +import Network.TypedProtocol.Lemmas +import Network.TypedProtocol.Peer -- | The 'connect' function takes two peers that agree on a protocol and runs diff --git a/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs b/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs index 40118617..015f8ae6 100644 --- a/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs +++ b/typed-protocols/stateful-cborg/Network/TypedProtocol/Stateful/Codec/CBOR.hs @@ -5,22 +5,22 @@ module Network.TypedProtocol.Stateful.Codec.CBOR , mkCodecCborStrictBS ) where -import Control.Monad.Class.MonadST (MonadST (..)) - -import qualified Codec.CBOR.Decoding as CBOR (Decoder) -import qualified Codec.CBOR.Encoding as CBOR (Encoding) -import qualified Codec.CBOR.Read as CBOR -import qualified Codec.CBOR.Write as CBOR -import qualified Data.ByteString as BS -import qualified Data.ByteString.Builder as BS -import qualified Data.ByteString.Builder.Extra as BS -import qualified Data.ByteString.Lazy as LBS -import qualified Data.ByteString.Lazy.Internal as LBS (smallChunkSize) - -import Network.TypedProtocol.Codec.CBOR (DeserialiseFailure, - convertCborDecoderBS, convertCborDecoderLBS) -import Network.TypedProtocol.Core -import Network.TypedProtocol.Stateful.Codec +import Control.Monad.Class.MonadST (MonadST (..)) + +import Codec.CBOR.Decoding qualified as CBOR (Decoder) +import Codec.CBOR.Encoding qualified as CBOR (Encoding) +import Codec.CBOR.Read qualified as CBOR +import Codec.CBOR.Write qualified as CBOR +import Data.ByteString qualified as BS +import Data.ByteString.Builder qualified as BS +import Data.ByteString.Builder.Extra qualified as BS +import Data.ByteString.Lazy qualified as LBS +import Data.ByteString.Lazy.Internal qualified as LBS (smallChunkSize) + +import Network.TypedProtocol.Codec.CBOR (DeserialiseFailure, + convertCborDecoderBS, convertCborDecoderLBS) +import Network.TypedProtocol.Core +import Network.TypedProtocol.Stateful.Codec -- | Construct a 'Codec' for a CBOR based serialisation format, using strict diff --git a/typed-protocols/stateful/Network/TypedProtocol.hs b/typed-protocols/stateful/Network/TypedProtocol.hs index b79a0aec..5f0d716d 100644 --- a/typed-protocols/stateful/Network/TypedProtocol.hs +++ b/typed-protocols/stateful/Network/TypedProtocol.hs @@ -16,9 +16,9 @@ module Network.TypedProtocol , module Network.TypedProtocol.Driver ) where -import Network.TypedProtocol.Core -import Network.TypedProtocol.Driver -import Network.TypedProtocol.Proofs +import Network.TypedProtocol.Core +import Network.TypedProtocol.Driver +import Network.TypedProtocol.Proofs -- $intro diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs index 4b447a5b..84f5c238 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Codec.hs @@ -43,15 +43,14 @@ module Network.TypedProtocol.Stateful.Codec , prop_codecs_compat ) where -import Data.Kind (Type) -import Data.Monoid (All (..)) +import Data.Kind (Type) +import Data.Monoid (All (..)) -import Network.TypedProtocol.Codec (CodecFailure (..), - DecodeStep (..), SomeMessage (..), hoistDecodeStep, - isoDecodeStep, mapFailureDecodeStep, runDecoder, - runDecoderPure) -import qualified Network.TypedProtocol.Codec as TP hiding (AnyMessageAndAgency) -import Network.TypedProtocol.Core +import Network.TypedProtocol.Codec (CodecFailure (..), DecodeStep (..), + SomeMessage (..), hoistDecodeStep, isoDecodeStep, + mapFailureDecodeStep, runDecoder, runDecoderPure) +import Network.TypedProtocol.Codec qualified as TP hiding (AnyMessageAndAgency) +import Network.TypedProtocol.Core -- | A stateful codec. diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs index 293478fb..0209df08 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Driver.hs @@ -11,13 +11,13 @@ module Network.TypedProtocol.Stateful.Driver , DecodeStep (..) ) where -import Control.Monad.Class.MonadSTM +import Control.Monad.Class.MonadSTM -import Data.Kind (Type) +import Data.Kind (Type) -import Network.TypedProtocol.Codec (DecodeStep (..), SomeMessage (..)) -import Network.TypedProtocol.Core -import Network.TypedProtocol.Stateful.Peer +import Network.TypedProtocol.Codec (DecodeStep (..), SomeMessage (..)) +import Network.TypedProtocol.Core +import Network.TypedProtocol.Stateful.Peer data Driver ps (pr :: PeerRole) bytes failure dstate f m = Driver { diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs index 01192085..bbe6518b 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer.hs @@ -8,9 +8,9 @@ -- module Network.TypedProtocol.Stateful.Peer (Peer (..)) where -import Data.Kind (Type) +import Data.Kind (Type) -import Network.TypedProtocol.Core as Core +import Network.TypedProtocol.Core as Core -- | A description of a peer that engages in a protocol. diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Client.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Client.hs index 6ea19b69..fc027040 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Client.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Client.hs @@ -13,11 +13,11 @@ module Network.TypedProtocol.Stateful.Peer.Client , pattern Done ) where -import Data.Kind (Type) +import Data.Kind (Type) -import Network.TypedProtocol.Core -import Network.TypedProtocol.Stateful.Peer (Peer) -import qualified Network.TypedProtocol.Stateful.Peer as TP +import Network.TypedProtocol.Core +import Network.TypedProtocol.Stateful.Peer (Peer) +import Network.TypedProtocol.Stateful.Peer qualified as TP type Client :: forall ps diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Server.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Server.hs index 5bec9ee4..803810a6 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Server.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Peer/Server.hs @@ -13,11 +13,11 @@ module Network.TypedProtocol.Stateful.Peer.Server , pattern Done ) where -import Data.Kind (Type) +import Data.Kind (Type) -import Network.TypedProtocol.Core -import Network.TypedProtocol.Stateful.Peer (Peer) -import qualified Network.TypedProtocol.Stateful.Peer as TP +import Network.TypedProtocol.Core +import Network.TypedProtocol.Stateful.Peer (Peer) +import Network.TypedProtocol.Stateful.Peer qualified as TP type Server :: forall ps diff --git a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs index 0c6f2c31..7e135e57 100644 --- a/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs +++ b/typed-protocols/stateful/Network/TypedProtocol/Stateful/Proofs.hs @@ -15,16 +15,16 @@ module Network.TypedProtocol.Stateful.Proofs , removeState ) where -import Control.Monad.Class.MonadSTM +import Control.Monad.Class.MonadSTM -import Data.Kind (Type) -import Data.Singletons +import Data.Kind (Type) +import Data.Singletons -import Network.TypedProtocol.Core -import Network.TypedProtocol.Peer -import Network.TypedProtocol.Proofs (TerminalStates (..)) -import qualified Network.TypedProtocol.Proofs as TP -import qualified Network.TypedProtocol.Stateful.Peer as ST +import Network.TypedProtocol.Core +import Network.TypedProtocol.Peer +import Network.TypedProtocol.Proofs (TerminalStates (..)) +import Network.TypedProtocol.Proofs qualified as TP +import Network.TypedProtocol.Stateful.Peer qualified as ST diff --git a/typed-protocols/test/Main.hs b/typed-protocols/test/Main.hs index 950738d6..783f6707 100644 --- a/typed-protocols/test/Main.hs +++ b/typed-protocols/test/Main.hs @@ -1,9 +1,9 @@ module Main (main) where -import Test.Tasty +import Test.Tasty -import qualified Network.TypedProtocol.PingPong.Tests as PingPong -import qualified Network.TypedProtocol.ReqResp.Tests as ReqResp +import Network.TypedProtocol.PingPong.Tests qualified as PingPong +import Network.TypedProtocol.ReqResp.Tests qualified as ReqResp main :: IO () main = defaultMain tests diff --git a/typed-protocols/test/Network/TypedProtocol/PingPong/Tests.hs b/typed-protocols/test/Network/TypedProtocol/PingPong/Tests.hs index 12aa5934..2a486796 100644 --- a/typed-protocols/test/Network/TypedProtocol/PingPong/Tests.hs +++ b/typed-protocols/test/Network/TypedProtocol/PingPong/Tests.hs @@ -1,4 +1,4 @@ -{-# LANGUAGE CPP #-} +{-# LANGUAGE CPP #-} -- orphaned arbitrary instances {-# OPTIONS_GHC -Wno-orphans #-} @@ -11,39 +11,39 @@ module Network.TypedProtocol.PingPong.Tests ) where -import Network.TypedProtocol.Channel -import Network.TypedProtocol.Codec -import Network.TypedProtocol.Driver.Simple -import Network.TypedProtocol.Proofs +import Network.TypedProtocol.Channel +import Network.TypedProtocol.Codec +import Network.TypedProtocol.Driver.Simple +import Network.TypedProtocol.Proofs -import Network.TypedProtocol.PingPong.Client -import Network.TypedProtocol.PingPong.Codec -import qualified Network.TypedProtocol.PingPong.Codec.CBOR as CBOR -import Network.TypedProtocol.PingPong.Examples -import Network.TypedProtocol.PingPong.Server -import Network.TypedProtocol.PingPong.Type +import Network.TypedProtocol.PingPong.Client +import Network.TypedProtocol.PingPong.Codec +import Network.TypedProtocol.PingPong.Codec.CBOR qualified as CBOR +import Network.TypedProtocol.PingPong.Examples +import Network.TypedProtocol.PingPong.Server +import Network.TypedProtocol.PingPong.Type -import Control.Monad.Class.MonadAsync -import Control.Monad.Class.MonadSTM -import Control.Monad.Class.MonadThrow -import Control.Monad.IOSim (runSimOrThrow) -import Control.Monad.ST (runST) -import Control.Tracer (nullTracer) +import Control.Monad.Class.MonadAsync +import Control.Monad.Class.MonadSTM +import Control.Monad.Class.MonadThrow +import Control.Monad.IOSim (runSimOrThrow) +import Control.Monad.ST (runST) +import Control.Tracer (nullTracer) -import Data.Functor.Identity (Identity (..)) -import Data.List (inits, tails) +import Data.Functor.Identity (Identity (..)) +import Data.List (inits, tails) -import qualified Data.ByteString.Lazy as LBS +import Data.ByteString.Lazy qualified as LBS #if !defined(mingw32_HOST_OS) -import qualified Network.Socket as Socket -import System.Directory (removeFile) -import System.IO -import qualified System.Posix.Files as Posix +import Network.Socket qualified as Socket +import System.Directory (removeFile) +import System.IO +import System.Posix.Files qualified as Posix #endif -import Test.QuickCheck -import Test.Tasty (TestTree, testGroup) -import Test.Tasty.QuickCheck (testProperty) +import Test.QuickCheck +import Test.Tasty (TestTree, testGroup) +import Test.Tasty.QuickCheck (testProperty) -- diff --git a/typed-protocols/test/Network/TypedProtocol/ReqResp/Tests.hs b/typed-protocols/test/Network/TypedProtocol/ReqResp/Tests.hs index 0dfdf648..6826e295 100644 --- a/typed-protocols/test/Network/TypedProtocol/ReqResp/Tests.hs +++ b/typed-protocols/test/Network/TypedProtocol/ReqResp/Tests.hs @@ -1,48 +1,48 @@ -{-# LANGUAGE CPP #-} +{-# LANGUAGE CPP #-} -- orphaned arbitrary instances {-# OPTIONS_GHC -Wno-orphans #-} module Network.TypedProtocol.ReqResp.Tests (tests) where -import Network.TypedProtocol.Channel -import Network.TypedProtocol.Codec -import Network.TypedProtocol.Driver.Simple -import Network.TypedProtocol.Proofs - -import Network.TypedProtocol.ReqResp.Client -import Network.TypedProtocol.ReqResp.Codec -import qualified Network.TypedProtocol.ReqResp.Codec.CBOR as CBOR -import Network.TypedProtocol.ReqResp.Examples -import Network.TypedProtocol.ReqResp.Server -import Network.TypedProtocol.ReqResp.Type - -import Control.Exception (throw) -import Control.Monad.Class.MonadAsync -import Control.Monad.Class.MonadST -import Control.Monad.Class.MonadSTM -import Control.Monad.Class.MonadThrow -import Control.Monad.Class.MonadTimer.SI -import Control.Monad.IOSim -import Control.Monad.ST (runST) -import Control.Tracer (nullTracer) - -import Data.Functor.Identity (Identity (..)) -import Data.List (intercalate, mapAccumL) -import Data.Tuple (swap) +import Network.TypedProtocol.Channel +import Network.TypedProtocol.Codec +import Network.TypedProtocol.Driver.Simple +import Network.TypedProtocol.Proofs + +import Network.TypedProtocol.ReqResp.Client +import Network.TypedProtocol.ReqResp.Codec +import Network.TypedProtocol.ReqResp.Codec.CBOR qualified as CBOR +import Network.TypedProtocol.ReqResp.Examples +import Network.TypedProtocol.ReqResp.Server +import Network.TypedProtocol.ReqResp.Type + +import Control.Exception (throw) +import Control.Monad.Class.MonadAsync +import Control.Monad.Class.MonadST +import Control.Monad.Class.MonadSTM +import Control.Monad.Class.MonadThrow +import Control.Monad.Class.MonadTimer.SI +import Control.Monad.IOSim +import Control.Monad.ST (runST) +import Control.Tracer (nullTracer) + +import Data.Functor.Identity (Identity (..)) +import Data.List (intercalate, mapAccumL) +import Data.Tuple (swap) #if !defined(mingw32_HOST_OS) -import qualified Network.Socket as Socket -import System.Directory (removeFile) -import System.IO -import qualified System.Posix.Files as Posix +import Network.Socket qualified as Socket +import System.Directory (removeFile) +import System.IO +import System.Posix.Files qualified as Posix #endif -import Network.TypedProtocol.PingPong.Tests (splits2, splits2BS, - splits3, splits3BS) +import Network.TypedProtocol.PingPong.Tests (splits2, splits2BS, splits3, + splits3BS) -import Test.QuickCheck -import Test.Tasty (TestTree, testGroup) -import Test.Tasty.QuickCheck (testProperty) -import Text.Show.Functions () +import Test.QuickCheck +import Test.Tasty (TestTree, testGroup) +import Test.Tasty.QuickCheck (testProperty) +import Text.Show.Functions () --