-
-
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
move the Id type alias to the Id object #186
Conversation
this fixes typelevel#185 also adds docs to the website for Id, so if you merge, please consider running ghpagesPushSite.
def coflatMap[A, B](a: Id[A])(f: Id[A] => B): Id[B] | ||
``` | ||
|
||
But then realize that in the flatMap signature, since `Id[B]` is the |
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.
it looks a bit weird to start this sentence with "But then" but it is probably because I am not a native speaker.
I might have said something like: "when you compare ... you realize that if you replace Id[X] by X, they all have the same signature which is simply function application"
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.
@julien-truffaut added a new commit with a correction, tell me if this reads better for you.
it looks great! |
👍 |
Should
which is only strictly true if it is. |
@milessabin that's a good question. I've never found myself wanting @milessabin in the (current) case of |
Also I'm okay with merging this now and addressing the covariant question separately. |
Alternatively, could we move the |
On reflection I think your wording is fine. Substitution is fine for values, just not for types. This is odd, to put it mildly, but I think that's @odersky's problem, not ours ;-) |
👍 |
@mpilquist I like |
@julien-truffaut That's definitely understandable. At the same time, many users will never look at the source -- or at least will never want to look at the source. I guess the question is whether avoiding the strangeness of |
@mpilquist completely agree |
I've always found |
I like @mpilquist's suggestion here. Let's try it? (I would be open to @stew doing it here or someone else opening a competing PR.) |
Oh, one improvement -- we could actually just define it as a companion directly in the package object. package object cats {
type Id[A] = A
object Id extends Bimonad[Id] ...
} |
|
... or does that cause ambiguity? |
Right, yes, sorry
|
yeah, that works for me, added a commit which moves the implicit into the package object. |
@stew ruh roh, build failed :-/ |
👍 |
move the Id type alias to the Id object
this fixes #185
also adds docs to the website for Id, so if you merge, please consider running ghpagesPushSite.