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

Using regular syntax in the FreeApplicative tutorial (#1471) #1472

Merged
merged 2 commits into from
May 13, 2017
Merged

Using regular syntax in the FreeApplicative tutorial (#1471) #1472

merged 2 commits into from
May 13, 2017

Conversation

denisftw
Copy link
Contributor

As suggested in #1471, this PR adjusts examples in the FreeApplicative tutorial to use regular syntax instead of kind projector's lambdas.

@codecov-io
Copy link

codecov-io commented Nov 21, 2016

Codecov Report

Merging #1472 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1472   +/-   ##
=======================================
  Coverage   93.33%   93.33%           
=======================================
  Files         240      240           
  Lines        3947     3947           
  Branches      137      137           
=======================================
  Hits         3684     3684           
  Misses        263      263

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 5340ee6...50e0a2c. Read the comment docs.

@peterneyens
Copy link
Collaborator

Thanks @denisftw 👍

@kailuowang
Copy link
Contributor

I think it makes sense to use the regular syntax in the example. But polymorphic lambdas was very handy in such situations. And if I remember correctly, such application in Free was one of the incentives of introducing polymorphic lambda in kind projector. We also use it in cats code. It might be worthwhile to mention polymorphic lambda here and use one of the FunctionK instance as an example? Something like,

or with  [polymorphic lambdas](https://github.com/non/kind-projector/#polymorphic-lambda-values) provided by kind-projector, you can write compiler as 
 val compiler = λ[FunctionK[ValidationOp, FromString]] { fa => 
    ....

@denisftw @peterneyens what do you guys think?

@peterneyens
Copy link
Collaborator

It is indeed a good idea to mention the polymorphic lambda syntax and include such an example.

We could probably also add something about the polymorphic lambda syntax to the section about kind projector in the FAQ.

@non
Copy link
Contributor

non commented Nov 28, 2016

Sounds good to me. 👍

@johnynek
Copy link
Contributor

This one fell through the cracks.

I'm +1 on what has been said:

  1. for beginners, use the verbose syntax.
  2. also explain that it could have been written using the compiler plugin with the lambda syntax.

@ceedubs
Copy link
Contributor

ceedubs commented May 13, 2017

Thanks @denisftw! I really like this change. I'm sorry that it fell between the cracks.

I'm 👍 on merging this, and there are now FunctionK docs that describe using the polymorphic lambda syntax, so I don't think that we need to duplicate it in the FreeApplicative docs.

Unfortunately, there is a merge conflict. Would you want to resolve that? If not, I can take your work and turn it into a new PR.

@denisftw
Copy link
Contributor Author

Sure, I'll take a look tomorrow.

@ceedubs
Copy link
Contributor

ceedubs commented May 13, 2017

Thanks @denisftw!

@ceedubs ceedubs merged commit 6bb1ca1 into typelevel:master May 13, 2017
@kailuowang kailuowang added this to the 1.0.0-MF milestone Aug 1, 2017
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.

7 participants