Skip to content

Instantly share code, notes, and snippets.

@BlackPrincess
Created December 5, 2013 06:14
Show Gist options
  • Select an option

  • Save BlackPrincess/7800880 to your computer and use it in GitHub Desktop.

Select an option

Save BlackPrincess/7800880 to your computer and use it in GitHub Desktop.
こんな感じの探してます
class E[A](a:A) {
def ~>(f:A => Any) = {
f(a)
this
}
def >>=[B](f:A => B) = f(a)
}
object E {
def apply[A](a:A) = new E[A](a)
}
E[Properties](properties)
.~> { _.setProperty("foo", "a") }
.~> { _.setProperty("bar", "b") } >>= {_}
// E[Properties](properties).setProperty("foo", "a").setProperty("bar", "b").get
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment