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 a few new laws and optimizations #58

Merged
merged 4 commits into from Nov 11, 2020
Merged

Conversation

johnynek
Copy link
Collaborator

A few more laws occurred to me so I added them.

At the same time, I realized we could leverage some of those properties when statically building up the parsers to make them a bit simpler.

@codecov-io
Copy link

Codecov Report

Merging #58 (5f7aa31) into main (02f2501) will increase coverage by 0.77%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #58      +/-   ##
==========================================
+ Coverage   96.10%   96.88%   +0.77%     
==========================================
  Files           3        3              
  Lines         565      578      +13     
  Branches       54       57       +3     
==========================================
+ Hits          543      560      +17     
+ Misses         22       18       -4     
Impacted Files Coverage Δ
core/shared/src/main/scala/cats/parse/Parser.scala 97.74% <100.00%> (-0.14%) ⬇️
...shared/src/main/scala/cats/parse/Accumulator.scala 82.85% <0.00%> (+14.28%) ⬆️

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 02f2501...5f7aa31. Read the comment docs.

Comment on lines 840 to 841
case Impl.Fail() => Impl.Fail()
case Impl.FailWith(str) => Impl.FailWith(str)
Copy link
Member

Choose a reason for hiding this comment

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

Can you reuse the same instances with a cast here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I could, but my heuristic is that paser build time is cheap (done once), but parser run time is where we want to optimize, so I didn't bother... but why not...

Copy link
Member

Choose a reason for hiding this comment

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

😆, I guess we each persuaded the other. I'm happy either way.

@johnynek
Copy link
Collaborator Author

took your suggestion @rossabaker

@johnynek johnynek merged commit 0bc2f47 into main Nov 11, 2020
@johnynek johnynek deleted the oscar/new_laws_new_static_opt branch November 11, 2020 22:55
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.

None yet

3 participants