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

Added PlutusTx.SortedMap #5812

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Added PlutusTx.SortedMap #5812

wants to merge 2 commits into from

Conversation

bezirg
Copy link
Contributor

@bezirg bezirg commented Feb 28, 2024

DO NOT LOOK HERE YET @paluh
Pre-submit checklist:

  • Branch
    • Tests are provided (if possible)
    • Commit sequence broadly makes sense
    • Key commits have useful messages
    • Changelog fragments have been written (if appropriate)
    • Relevant tickets are mentioned in commit messages
    • Formatting, PNG optimization, etc. are updated
  • PR
    • (For external contributions) Corresponding issue exists and is linked in the description
    • Targeting master unless this is a cherry-pick backport
    • Self-reviewed the diff
    • Useful pull request description
    • Reviewer requested

@bezirg bezirg self-assigned this Feb 28, 2024
@bezirg bezirg added Do not merge Don't look here yet EXPERIMENT Experiments that we probably don't want to merge labels Feb 28, 2024
@bezirg bezirg force-pushed the bezirg/sortedmap branch 3 times, most recently from 81ff187 to 0450d93 Compare February 28, 2024 22:06
@colll78
Copy link
Contributor

colll78 commented Sep 4, 2024

Please add a tryLookup function. Typically, the use of optional types (i.e. Maybe and similar constructs) is considered an anti-pattern in most production onchain codebases. Often you want fast fail semantics and even in cases that you don't it is common to handle the not-found path with a continuation functions. In general, please expose 'try' variants for any functions which return optional types in the standard library because in practice the optional variants are almost never used.

Also please add the same for all other iterations of Map or structures with a lookup or find function. If you look at any production smart contract codebase you will almost never see the Maybe or sum type variants of such functions used. In practice, ex-unit optimization is simply too important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do not merge Don't look here yet EXPERIMENT Experiments that we probably don't want to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants