-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Topic/scaladoc coflat comonad #131 #898
Topic/scaladoc coflat comonad #131 #898
Conversation
Seems to be a variation of typelevel/simulacrum#9 and #6. Though those particular issues seems to be resolved, macro expansion for
The following cut back example for package cats
import simulacrum.typeclass
/**
* Must obey the laws defined in cats.laws.ComonadLaws.
*/
@typeclass trait Comonad[F[_]] extends CoflatMap[F] {
/** Breaks macro expansion of the Comonad Object */
def extract[A](x: F[A]): A
} |
Thanks, @mikejcurry, will take a stab at solving the docs/makeSite for 2.10.6 locally and see if I can get a build to pass after that. |
Hey @ceedubs, I'm sorry to say that it looks like the build fail issue on Scala 2.10.6 appears to be over my head :( |
@mpilquist or @travisbrown do you have any ideas on this? |
@ceedubs This is kind of frightening but I have no recollection of ever having written any of the stuff I apparently wrote in #6. Since then I've run into similar problems in the circe modules that use macros heavily, and my solution has been just to exclude them from the 2.10 doc tasks—I just haven't had time to care. |
Current coverage is
|
* scala> import cats.Comonad | ||
* scala> val id = Id.pure(3) | ||
* scala> Comonad[Id].extract(id) | ||
* res0: cats.Id[Int] = 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is minor, but could we make this res0: Int = 3
? I think that would make it a bit more clear that extract
pulls an A
out of an F
context. Id
is the weird case where Id[A]
and A
happen to be the same.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also we'll need to change Id.pure
after #955. We could either do val id: Id[Int] = 3
or we could do something like Applicative[Id].pure(3)
.
Hmm.. looks like I missed somewhere with disabling the doc generation for 2.10. :-(. It got past building the site this time, but looks like the doc generation is maybe run again as part of packaging or something. I'll have a look and see if anything jumps out. |
@lukewyman sorry, but it looks like there is a compile error now due to |
Thanks, @ceedubs, I'll get it cleaned up this weekend. |
👍 |
As a fun fact, adding a dummie @typeclass trait Comonad[F[_]] extends CoflatMap[F] {
/**
* `extract` is the dual of `pure` on Monad (via `Applicative`)
* ....
*/
def extract[A](x: F[A]): A
private val dummy = ()
}
obviously, I am not suggesting this as a fix, just a fun note. |
Please note that once #1006 is merged, this one would be breaking the build again, please rerun the build to reflect that.
|
update to my previous comment, as this comment pointed out:
So #959 (already reverted) would have to create some fake javadoc.jar in the release process. |
This seems great to me. 👍 |
Added scaladoc comments with REPL examples.