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

Add and use kind-projector #3650

Merged
merged 8 commits into from Oct 26, 2017

Conversation

Projects
None yet
3 participants
@dwijnand
Member

dwijnand commented Oct 20, 2017

No description provided.

@ShaneDelmore

This comment has been minimized.

Show comment
Hide comment
@ShaneDelmore

ShaneDelmore Oct 20, 2017

That’s some pretty nice improvements to readability 👍

ShaneDelmore commented Oct 20, 2017

That’s some pretty nice improvements to readability 👍

@eed3si9n

A minor comment.

strictConstant(allScopes.asInstanceOf[T]) // can't convince scalac that StaticScopes => T == Set[Scope]
}
private[this] val transform: Initialize ~> INode = λ[Initialize ~> INode] {
case k: Keyed[s, A1$] @unchecked => single(getStatic(k.scopedKey), k.transform)

This comment has been minimized.

@eed3si9n

eed3si9n Oct 20, 2017

Member

What's this dollar sign mean here?

@eed3si9n

eed3si9n Oct 20, 2017

Member

What's this dollar sign mean here?

This comment has been minimized.

@dwijnand

dwijnand Oct 20, 2017

Member

A1$ is the name of the generated type parameter of ~>'s apply, which was T before.

Basically this is what I found works that allows use to use polymorphic lambda syntax even in places where we need the type param. It's more on the risky side of things in this diff. Btw there are 2 cases in InputTask.scala where I couldn't find any way to use the syntax, so it uses old school anonymous inner classes.

@dwijnand

dwijnand Oct 20, 2017

Member

A1$ is the name of the generated type parameter of ~>'s apply, which was T before.

Basically this is what I found works that allows use to use polymorphic lambda syntax even in places where we need the type param. It's more on the risky side of things in this diff. Btw there are 2 cases in InputTask.scala where I couldn't find any way to use the syntax, so it uses old school anonymous inner classes.

def apply[T](key: AttributeKey[T]): T = map(key)
}
implicit def toNatTrans(map: AttributeMap): AttributeKey ~> Id = λ[AttributeKey ~> Id](map(_))

This comment has been minimized.

@eed3si9n

eed3si9n Oct 24, 2017

Member

I am perfectly happy to go with uber fp polyfunction value level λ notation, but I am really not sure if this increases the "readability."

@eed3si9n

eed3si9n Oct 24, 2017

Member

I am perfectly happy to go with uber fp polyfunction value level λ notation, but I am really not sure if this increases the "readability."

This comment has been minimized.

@dwijnand

dwijnand Oct 24, 2017

Member

Yeah.. I'm happy to see the reduction in boilerplate, but I'm still not 100% convinced.

@dwijnand

dwijnand Oct 24, 2017

Member

Yeah.. I'm happy to see the reduction in boilerplate, but I'm still not 100% convinced.

dwijnand added some commits Oct 18, 2017

@dwijnand dwijnand merged commit 7e1a904 into sbt:1.x Oct 26, 2017

2 checks passed

codacy/pr Good work! A positive pull request.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@dwijnand dwijnand deleted the dwijnand:kind-projector branch Oct 26, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment