Navigation Menu

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

Expand add5 to a 2-step process to show partial application #204

Merged
merged 2 commits into from Aug 27, 2019
Merged

Conversation

wjlow
Copy link
Owner

@wjlow wjlow commented Aug 19, 2019

When you do addCurried(x)(y), it's not immediately obvious that you can partially apply addCurried

Copy link
Collaborator

@lukestephenson lukestephenson left a comment

Choose a reason for hiding this comment

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

Seems ok. Note CI failed, so might need looking into

@@ -35,7 +35,10 @@ object IntroExercises {
* = 9
*
**/
def add5(x: Int): Int = ???
def add5(x: Int): Int = {
val f = ???
Copy link
Collaborator

Choose a reason for hiding this comment

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

maybe a type annotation on f so that people assign it to the right thing? Otherwise they could just do:

val f = add(5)(x)
f

Copy link
Owner Author

Choose a reason for hiding this comment

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

Great point! Change made.

I don't understand the CI failure, something to do with oraclejdk :/

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think the CI has been fixed, might just need a rebase.

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.

None yet

2 participants