Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better stateful API #61

Merged
merged 5 commits into from
Sep 26, 2024
Merged

Better stateful API #61

merged 5 commits into from
Sep 26, 2024

Commits on Sep 24, 2024

  1. typed-protocols-stateful: pass initial state through Yield

    This removes the need to pass it in messages, like we used to in
    `MsgResp` in `typed-protocols-examples`.
    
    The `Driver` and `Codec` were modified:
    * `encode` and `sendMessage` receive the initial state of the protocol
      state transition imposed by a message, which is dual to
    * `decode` and `recvMessage` receive the final state of the protocol
      state transition imposed by a message
    
    This is seems more natural than always passing the final state.
    
    The drawback of this systemic approach is that every `Yield` needs
    access to both initial and final state of a transition.  In previous
    approach one had more control over which messages require access to the
    initial state (e.g. `MsgRecv` in `Stateful.ReqResp`) - although it was
    looking more like a hack since that part of a message wasn't sent over
    the wire.
    coot committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    782eee2 View commit details
    Browse the repository at this point in the history
  2. typed-protocols-codec: changed how AnyMessageAndAgency is exported

    Also done for typed-protocols-stateful-codec.
    coot committed Sep 24, 2024
    Configuration menu
    Copy the full SHA
    d248fe8 View commit details
    Browse the repository at this point in the history

Commits on Sep 26, 2024

  1. Configuration menu
    Copy the full SHA
    4dca01b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9cbb855 View commit details
    Browse the repository at this point in the history
  3. typed-protocols-0.3.0.0: bumped versions

    Also use `cabal-version: 3.4` in all packages.
    coot committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    dc0105c View commit details
    Browse the repository at this point in the history