cardano-ledger icon indicating copy to clipboard operation
cardano-ledger copied to clipboard

Ts sharing coders

Open TimSheard opened this issue 1 year ago • 0 comments

Extends the Coders library to handle Sharing on the decode side. Adds some DecShareCBOR instances as described in issue #3486 using the new tools

Began to address the problems described in issue #4192, about serializing CompactForm MultiAsset, without affecting backward compatibility.

A large part of the changes have to do with the following changes

  1. replacing Ann with Pure
  2. replacing (<!*) with (<!>)

The original operators Ann and (<!*) had to do the the Annotator type, but the ones have been generalized to work with any Applicative functor. Including the monad (StateT (Share b) (Decoder s) b) which is the basis for Sharing.

Checklist

  • [x] Commit sequence broadly makes sense and commits have useful messages
  • [ ] New tests are added if needed and existing tests are updated
  • [ ] When applicable, versions are updated in .cabal and CHANGELOG.md files according to the versioning process.
  • [ ] The version bounds in .cabal files for all affected packages are updated. If you change the bounds in a cabal file, that package itself must have a version increase. (See RELEASING.md)
  • [ ] All visible changes are prepended to the latest section of a CHANGELOG.md for the affected packages. New section is never added with the code changes. (See RELEASING.md)
  • [x] Code is formatted with fourmolu (use scripts/fourmolize.sh)
  • [x] Cabal files are formatted (use scripts/cabal-format.sh)
  • [x] hie.yaml has been updated (use scripts/gen-hie.sh)
  • [ ] Self-reviewed the diff

TimSheard avatar Mar 28 '24 01:03 TimSheard