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

Add syntax for Cats NonEmptyList #539

Merged
merged 1 commit into from
Jul 7, 2018

Conversation

cb372
Copy link
Contributor

@cb372 cb372 commented Jul 6, 2018

Adds a refinedSize extension method that returns the size of a NonEmptyList as a positive int.

Based on this Twitter thread, at least 2 people in the world want this 😄

@cb372 cb372 force-pushed the cats-NonEmptyList-syntax branch from 5895640 to 1ab5983 Compare July 7, 2018 17:20
@codecov
Copy link

codecov bot commented Jul 7, 2018

Codecov Report

Merging #539 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #539      +/-   ##
==========================================
+ Coverage   94.26%   94.27%   +<.01%     
==========================================
  Files          62       62              
  Lines         680      681       +1     
  Branches       14       14              
==========================================
+ Hits          641      642       +1     
  Misses         39       39
Impacted Files Coverage Δ
...rc/main/scala/eu/timepit/refined/cats/syntax.scala 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 190bfdb...1ab5983. Read the comment docs.

@fthomas
Copy link
Owner

fthomas commented Jul 7, 2018

This is great, thanks @cb372!

We could also have the same for the other NonEmpty types in Cats and also for the standard library collections to return a NonNegInt. Maybe there are more methods where we could provide a more precise return type.

@fthomas fthomas merged commit 4f0b315 into fthomas:master Jul 7, 2018
@cb372 cb372 deleted the cats-NonEmptyList-syntax branch July 7, 2018 22:23
fthomas added a commit that referenced this pull request Jul 13, 2018
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.

2 participants