Skip to content

Instantly share code, notes, and snippets.

@jwalgran
Last active August 29, 2015 13:56
Show Gist options
  • Save jwalgran/9234894 to your computer and use it in GitHub Desktop.
Save jwalgran/9234894 to your computer and use it in GitHub Desktop.
A proposed addition to geotrellis.logic
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