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

Implement List(iter,func) #2960

Merged
merged 1 commit into from
Nov 4, 2018
Merged

Conversation

fingolfin
Copy link
Member

@mohamed-barakat asked for it during the last GAP Days in September 2018, and now again @markuspf, so I polished up the code I wrote for @mohamed-barakat back then and added some tests.

@fingolfin fingolfin added kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: library labels Oct 31, 2018
@codecov
Copy link

codecov bot commented Oct 31, 2018

Codecov Report

Merging #2960 into master will decrease coverage by 8.74%.
The diff coverage is 100%.

@@            Coverage Diff             @@
##           master    #2960      +/-   ##
==========================================
- Coverage   83.79%   75.05%   -8.75%     
==========================================
  Files         682      624      -58     
  Lines      346236   311983   -34253     
==========================================
- Hits       290135   234162   -55973     
- Misses      56101    77821   +21720
Impacted Files Coverage Δ
lib/coll.gi 95.62% <100%> (-0.77%) ⬇️
lib/contfrac.gi 6.66% <0%> (-83.34%) ⬇️
lib/proto.gi 2.04% <0%> (-81.64%) ⬇️
lib/ctbllatt.gi 0.88% <0%> (-79.93%) ⬇️
lib/ctblauto.gi 6.15% <0%> (-77.9%) ⬇️
lib/teachm2.g 23.07% <0%> (-76.93%) ⬇️
lib/algliess.gi 0.99% <0%> (-74.51%) ⬇️
lib/ctblpope.gi 1.82% <0%> (-72.35%) ⬇️
src/modules.h 33.33% <0%> (-66.67%) ⬇️
lib/attr.gi 33.33% <0%> (-66.67%) ⬇️
... and 383 more

Copy link
Member

@markuspf markuspf left a comment

Choose a reason for hiding this comment

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

Looks good to me.

The only nitpick I have is that I think there's no documentation for this (which is a.. "more general problem").

@fingolfin
Copy link
Member Author

Also, I guess one could expect to have this also for Filtered, Number, ForAll, ForAny, Product, Sum, ...

I'll look into resurrecting another branch I made in the past which implements a generic FoldLeft function and reimplements all of the above on top of it, which would make it much easier to implement this atop.

@fingolfin
Copy link
Member Author

Regarding documentation, also List for a collection is not correctly documented: it omits the possibility to specify a function which is applied to all elements of the collection. Because List has two manual entries, one for lists and one for collections. This is unlike Filtered, Sum, etc., which all merge this into a single reference manual entry.

@markuspf
Copy link
Member

markuspf commented Nov 4, 2018

I'll just merge this, everything else can be done in later PRs anyway.

@markuspf markuspf merged commit 8870d04 into gap-system:master Nov 4, 2018
@fingolfin fingolfin deleted the mh/List-for-iter branch November 5, 2018 14:21
@fingolfin fingolfin added release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes release notes: added PRs introducing changes that have since been mentioned in the release notes and removed release notes: to be added PRs introducing changes that should be (but have not yet been) mentioned in the release notes labels Apr 15, 2019
@olexandr-konovalov olexandr-konovalov added this to the GAP 4.11.0 milestone Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements release notes: added PRs introducing changes that have since been mentioned in the release notes topic: library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants