Created
February 11, 2011 20:49
-
-
Save KirinDave/823000 to your computer and use it in GitHub Desktop.
begin0 for scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.banksimple.util | |
| private[util] final class Also[T](val origin: T) { | |
| def andAlso(x: T => Unit): T = { x(origin) ; origin } | |
| def andThen(x: => Unit): T = { x ; origin } | |
| } | |
| object Also { | |
| implicit def thing2Also[T](x: T): Also[T] = new Also(x) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment