Skip to content

Add MonoTraversable, MonoFoldable, MonoFunctor to the UTxO type #845

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

Merged
merged 1 commit into from
May 22, 2025

Conversation

carbolymer
Copy link
Contributor

Changelog

- description: |
    Add MonoTraversable, MonoFoldable, MonoFunctor to the UTxO type
# uncomment types applicable to the change:
  type:
  # - feature        # introduces a new feature
  # - breaking       # the API has changed in a breaking way
   - compatible     # the API has changed but is non-breaking
  # - optimisation   # measurable performance improvements
  # - refactoring    # QoL changes
  # - bugfix         # fixes a defect
  # - test           # fixes/modifies tests
  # - maintenance    # not directly related to the code
  # - release        # related to a new release preparation
  # - documentation  # change in code docs, haddocks...

Context

Adds Mono* classes instances useful when iterating over UTxO. https://hackage.haskell.org/package/mono-traversable-1.0.21.0/docs/Data-MonoTraversable.html

Checklist

  • Commit sequence broadly makes sense and commits have useful messages
  • New tests are added if needed and existing tests are updated. See Running tests for more details
  • Self-reviewed the diff

@carbolymer carbolymer marked this pull request as ready for review May 19, 2025 13:07
@carbolymer carbolymer self-assigned this May 19, 2025
@carbolymer carbolymer force-pushed the mgalazyn/feature/add-utxo-instances branch from 2025d04 to fb86e12 Compare May 19, 2025 13:07
@locallycompact
Copy link
Contributor

Thanks for this.

@locallycompact
Copy link
Contributor

I just tried this and it's quite a lot to import Data.MonoTraversable everywhere this is used. Can we still add the qualified interface as well as this?

@carbolymer
Copy link
Contributor Author

@locallycompact I'm not sure I follow. Would you like to have Data.MonoTraversable reexported?

@locallycompact
Copy link
Contributor

Re-exporting as in UTxO.ofoldMap etc? Either that or UTxO.foldMap etc would be the interface that I think is the most convenient, but I'd also expect the documentation to be monomorphic in terms of UTxO for reading consistency. That last bit might just be not especially important though.

@carbolymer
Copy link
Contributor Author

carbolymer commented May 22, 2025

@locallycompact ah I see. I don't have anything against exporting monomorphised functions. Which functions would like to have exported? There's a lot of them in https://hackage.haskell.org/package/mono-traversable-1.0.21.0/docs/Data-MonoTraversable.html .

@locallycompact
Copy link
Contributor

I think I got everything I wanted in this other PR I made, or very close:

https://github.com/IntersectMBO/cardano-api/pull/841/files

@carbolymer carbolymer added this pull request to the merge queue May 22, 2025
@carbolymer carbolymer removed this pull request from the merge queue due to a manual request May 22, 2025
@carbolymer carbolymer added this pull request to the merge queue May 22, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks May 22, 2025
@carbolymer carbolymer added this pull request to the merge queue May 22, 2025
Merged via the queue into master with commit 5e87da5 May 22, 2025
26 of 34 checks passed
@carbolymer carbolymer deleted the mgalazyn/feature/add-utxo-instances branch May 22, 2025 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants