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 Cofree.ana and Cofree.anaEval #2325

Merged
merged 4 commits into from
Jul 18, 2018
Merged

Conversation

andyscott
Copy link
Contributor

@andyscott andyscott commented Jul 16, 2018

Adds Cofree.ana (update: added anaEval too), which generalizes Cofree.unfold with a fused map. The map fused version is a bit more useful than the basic unfold, especially when you're unfolding from some other messy structure.

I stuck with the name from the Haskell category extras package but I suppose unfoldMap (or mapUnfold?) might also be a good name for this.

@codecov-io
Copy link

codecov-io commented Jul 16, 2018

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2325      +/-   ##
==========================================
+ Coverage   95.07%   95.08%   +<.01%     
==========================================
  Files         343      343              
  Lines        5931     5935       +4     
  Branches      217      216       -1     
==========================================
+ Hits         5639     5643       +4     
  Misses        292      292
Impacted Files Coverage Δ
free/src/main/scala/cats/free/Cofree.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 186dbab...a545438. Read the comment docs.

johnynek
johnynek previously approved these changes Jul 16, 2018
Copy link
Contributor

@johnynek johnynek left a comment

Choose a reason for hiding this comment

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

Looks great!

@andyscott andyscott changed the title Add Cofree.ana Add Cofree.ana and Cofree.anaE Jul 16, 2018
@LukaJCB
Copy link
Member

LukaJCB commented Jul 16, 2018

Looks good to me 👍

About naming, I think ana is a good name personally, but anaE is a bit strange, we have a bunch of functions that use Eval as a postfix, like map2Eval or productREval so maybe it's appropriate here too? :)

@andyscott
Copy link
Contributor Author

Seems reasonable to me. I'll unfold E to Eval 😄.

@andyscott andyscott changed the title Add Cofree.ana and Cofree.anaE Add Cofree.ana and Cofree.anaEval Jul 16, 2018
@andyscott
Copy link
Contributor Author

The build seems to have freaked out-- possibly related to GitHub being down briefly. I don't have permissions to restart it so maybe someone here could?

@tpolecat
Copy link
Member

done

@LukaJCB
Copy link
Member

LukaJCB commented Jul 18, 2018

Ready to merge @andyscott? :)

@andyscott
Copy link
Contributor Author

Yes, definitely 🤘

@kailuowang kailuowang added this to the 1.2 milestone Jul 18, 2018
@kailuowang kailuowang merged commit e15188b into typelevel:master Jul 18, 2018
@andyscott andyscott deleted the cofree-ana branch July 18, 2018 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants