Last active
August 29, 2015 13:56
-
-
Save jwalgran/9234894 to your computer and use it in GitHub Desktop.
A proposed addition to geotrellis.logic
This file contains 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 geotrellis.logic | |
import geotrellis._ | |
object Cons { | |
def apply[A](opList:Op[List[A]], op:Op[A]):Op[List[A]] = { | |
for (l <- opList; | |
a <- op) yield a :: l | |
} | |
implicit class ConsWrapper[A](opList: Op[List[A]]) { | |
def ::(op: Op[A]) = Cons(opList, op) | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment