Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ArrowAssoc replaced with an extension method
// From https://github.com/deanwampler/programming-scala-book-code-examples/
import scala.annotation.targetName
extension [A,B] (a: A):
// @targetName called @alpha before 3.0.0-M2:
@targetName("arrow2") def ~>(b: B): (A, B) = (a, b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.