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

Left-adjoint of forgetful functor #1056

Merged
merged 1 commit into from
Jun 2, 2016
Merged

Left-adjoint of forgetful functor #1056

merged 1 commit into from
Jun 2, 2016

Conversation

Madder
Copy link
Contributor

@Madder Madder commented May 23, 2016

Isn't it supposed to be the free functor?

@Madder Madder changed the title Left Adjoint of forgetful functor Left-adjoint of forgetful functor May 23, 2016
@@ -424,7 +424,7 @@ The above forgetful functor takes a `Monad` and:
- finally keeps the *functor* part (e.g. the `map` function)

By reversing all arrows to build the left-adjoint, we deduce that the
forgetful functor is basically a construction that:
free functor is basically a construction that:
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 in this context the author really meant this to read free monad. Thanks for pointing out the problem. Does this make sense to you?

@Madder
Copy link
Contributor Author

Madder commented May 30, 2016

I agree. He certainly means Free monad in this context. Free functor being the more general concept of a left-adjoint of a forgetful functor. Another issue I see is that pure is not the "applicative" part, as both pure and flatmap are part of the monad structure: applicative is simply a by product of being a monad.

@ceedubs
Copy link
Contributor

ceedubs commented May 31, 2016

@Madder thanks for pointing this out.

It sounds like we all agree that it should be changed to free monad.

As for at the "applicative part" - I can see the author's point (no pun intended, but I'll go with it) that by taking a Functor and adding pure you have an Applicative. But if you have ideas on how to improve the wording, they would be welcomed!

Would you be interested in submitting a PR for any changes you'd like to see?

@Madder
Copy link
Contributor Author

Madder commented Jun 1, 2016

@ceedubs Possibly a stupid question, but don't you need an apply : F[A=>B] => F[A] => F[B] or a map2 : (F[A],F[B]) => ((A,B) => C) => F[C] to get an Applicative out of a Functor? Or is pure enough somehow?

@ceedubs
Copy link
Contributor

ceedubs commented Jun 1, 2016

@Madder oops you are quite right :)

@codecov-io
Copy link

codecov-io commented Jun 1, 2016

Current coverage is 88.13%

Merging #1056 into master will not change coverage

@@             master      #1056   diff @@
==========================================
  Files           224        224          
  Lines          2839       2839          
  Methods        2782       2782          
  Messages          0          0          
  Branches         52         52          
==========================================
  Hits           2502       2502          
  Misses          337        337          
  Partials          0          0          

Sunburst

Powered by Codecov. Last updated by c43625e...b1b5985

@Madder
Copy link
Contributor Author

Madder commented Jun 1, 2016

@ceedubs I've updated the PR with free monad instead free functor. I've also replaced applicative with pointed which is more accurate but I'm not sure whether it fits in that context anymore... Let me know if you prefer another formulation. I can change the PR accordingly or submit a new one if preferable.

@ceedubs
Copy link
Contributor

ceedubs commented Jun 1, 2016

@Madder thank you. If someone wants to further refine this, they should feel free to, but 👍 from me.

@non
Copy link
Contributor

non commented Jun 2, 2016

👍 looks good to me. thanks for working on this!

@non non merged commit 7f112dd into typelevel:master Jun 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants