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 documentation for Show #1789

Merged
merged 4 commits into from
Sep 20, 2017
Merged

Conversation

LukaJCB
Copy link
Member

@LukaJCB LukaJCB commented Aug 5, 2017

This is still WIP as, kittens doesn't currently support Show (I hope to create PR soonish, https://github.com/milessabin/kittens/issues/40) @kailuowang also expressed interest :)

@codecov-io
Copy link

codecov-io commented Aug 5, 2017

Codecov Report

Merging #1789 into master will increase coverage by 0.09%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1789      +/-   ##
==========================================
+ Coverage   94.87%   94.97%   +0.09%     
==========================================
  Files         241      241              
  Lines        4139     4199      +60     
  Branches      103      108       +5     
==========================================
+ Hits         3927     3988      +61     
+ Misses        212      211       -1
Impacted Files Coverage Δ
core/src/main/scala/cats/Monad.scala 96% <0%> (-0.16%) ⬇️
core/src/main/scala/cats/functor/Bifunctor.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/syntax/monad.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/data/EitherT.scala 98.27% <0%> (ø) ⬆️
laws/src/main/scala/cats/laws/ApplyLaws.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/data/Tuple2K.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/syntax/cartesian.scala 50% <0%> (ø) ⬆️
...ws/src/main/scala/cats/kernel/laws/OrderLaws.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/instances/list.scala 100% <0%> (ø) ⬆️
core/src/main/scala/cats/Foldable.scala 100% <0%> (ø) ⬆️
... and 10 more

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 0519906...5aa684f. Read the comment docs.

```

This still may not seem useful to you, because case classes already automatically implement `toString`, while `show` would have to be implemented manually for each case class.
Thankfully with the help of a small library called [kittens](https://github.com/milessabin/kittens) a lot of type class instances including `Show` can be derived automatically!
Copy link
Contributor

Choose a reason for hiding this comment

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

So I guess your PR to add show to kittens is almost ready? BTW, in case you haven't seen this, miles wrote a shapeless example deriving a Show https://github.com/milessabin/shapeless/blob/master/examples/src/main/scala/shapeless/examples/shows.scala

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh wow, I didn't know about LabelledTypeClass, thank you so much! :)

@kailuowang kailuowang modified the milestone: 1.0.0-RC1 Aug 8, 2017
@LukaJCB LukaJCB mentioned this pull request Aug 8, 2017
70 tasks
@kailuowang kailuowang modified the milestone: 1.0.0-RC1 Aug 29, 2017
@kailuowang
Copy link
Contributor

kittens 1.0.0-RC0 is released with Show derivation (even added the example to the README).

Copy link
Contributor

@ceedubs ceedubs left a comment

Choose a reason for hiding this comment

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

Nice!

@kailuowang
Copy link
Contributor

👍

@kailuowang kailuowang merged commit ed4dbac into typelevel:master Sep 20, 2017
@kailuowang kailuowang added this to the 1.0.0-RC1 milestone Oct 13, 2017
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.

4 participants