Skip to content

add optional to Applicative #1560

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

Closed
wants to merge 1 commit into from
Closed

add optional to Applicative #1560

wants to merge 1 commit into from

Conversation

julien-truffaut
Copy link
Contributor

No description provided.

@kailuowang
Copy link
Contributor

kailuowang commented Mar 15, 2017

Edit: duh, I didn't see the pure , never mind my question. but I agree with @johnynek

I am curious can this in be in Functor?

@@ -37,6 +37,10 @@ import simulacrum.typeclass
def sequence[G[_], A](as: G[F[A]])(implicit G: Traverse[G]): F[G[A]] =
G.sequence(as)(this)

/** one or none */
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we need more comments than this. For F = List this will be one and none (we will always concatenate None to the list), so it behavior seems highly dependant on the F.

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the intended usecase of this method?

@codecov-io
Copy link

codecov-io commented Mar 15, 2017

Codecov Report

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

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1560      +/-   ##
==========================================
+ Coverage   92.49%   92.49%   +<.01%     
==========================================
  Files         246      246              
  Lines        3891     3892       +1     
  Branches      136      135       -1     
==========================================
+ Hits         3599     3600       +1     
  Misses        292      292
Impacted Files Coverage Δ
core/src/main/scala/cats/Applicative.scala 70% <100%> (+3.33%) ⬆️

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 954b4e2...aae2e76. Read the comment docs.

@julien-truffaut
Copy link
Contributor Author

@kailuowang we need pure from Applicative, I don't think it can be a Functor

@johnynek I thought about the same just after submitting the PR, as you say the behaviour depends mainly on F. Do you have a suggestion for another doc?

@kailuowang kailuowang added this to the 1.0.0-MF milestone Apr 11, 2017
@kailuowang kailuowang mentioned this pull request May 25, 2017
26 tasks
@kailuowang
Copy link
Contributor

@julien-truffaut do you need this for the next release?

@julien-truffaut
Copy link
Contributor Author

julien-truffaut commented Jul 13, 2017 via email

@kailuowang
Copy link
Contributor

Closing stale PRs. Feel free to reopen if there is interest to revive the effort.

@kailuowang kailuowang closed this Aug 5, 2019
@johnynek
Copy link
Contributor

johnynek commented Aug 5, 2019

just a note, isn't Applicative + SemigroupK == Alternative? shouldn't this be on alternative?

@LukaJCB
Copy link
Member

LukaJCB commented Aug 5, 2019

@johnynek Applicative + MonoidK == Alternative, not SemigroupK alone

@larsrh larsrh deleted the optional branch April 11, 2020 09:48
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.

7 participants