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

Introduce map in Fixed/Variable sized Array types #2737

Merged
merged 5 commits into from
Aug 23, 2023

Conversation

darkdrag00nv2
Copy link
Contributor

@darkdrag00nv2 darkdrag00nv2 commented Aug 18, 2023

Work towards #2605

Description

Introduce map function for creating a copy of an Array value with its entries transformed by a transformation function.

This function would be unavailable to resource arrays. It can be enabled for resources as a reference in the future.

Will send docs PR post the merge.


  • Targeted PR against master branch
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work
  • Code follows the standards mentioned here
  • Updated relevant documentation
  • Re-reviewed Files changed in the Github PR explorer
  • Added appropriate labels

@darkdrag00nv2 darkdrag00nv2 changed the title Introduce map in Fixed/Variable sized Array types Introduce map in Fixed/Variable sized Array types Aug 18, 2023
@codecov
Copy link

codecov bot commented Aug 18, 2023

Codecov Report

Merging #2737 (519407f) into master (510df95) will increase coverage by 0.03%.
Report is 2 commits behind head on master.
The diff coverage is 90.54%.

@@            Coverage Diff             @@
##           master    #2737      +/-   ##
==========================================
+ Coverage   79.15%   79.18%   +0.03%     
==========================================
  Files         333      333              
  Lines       78379    78527     +148     
==========================================
+ Hits        62037    62183     +146     
+ Misses      14044    14043       -1     
- Partials     2298     2301       +3     
Flag Coverage Δ
unittests 79.18% <90.54%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
runtime/interpreter/value.go 67.13% <85.54%> (+0.11%) ⬆️
runtime/sema/type.go 90.00% <96.92%> (+0.25%) ⬆️

... and 2 files with indirect coverage changes

Copy link
Member

@turbolent turbolent left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

runtime/interpreter/value.go Outdated Show resolved Hide resolved
runtime/interpreter/value.go Outdated Show resolved Hide resolved
runtime/interpreter/value.go Outdated Show resolved Hide resolved
darkdrag00nv2 and others added 2 commits August 19, 2023 20:08
Co-authored-by: Bastian Müller <bastian@turbolent.com>
runtime/interpreter/value.go Outdated Show resolved Hide resolved
Co-authored-by: Bastian Müller <bastian@turbolent.com>
@darkdrag00nv2
Copy link
Contributor Author

@turbolent @SupunS Addressed feedback. Should be ready to merge!

@SupunS SupunS merged commit 8cd7819 into onflow:master Aug 23, 2023
@darkdrag00nv2 darkdrag00nv2 deleted the map_function_array branch August 25, 2023 10:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants