Skip to content

Instantly share code, notes, and snippets.

View yadavan88's full-sized avatar

Yadu Krishnan yadavan88

View GitHub Profile
@cvogt
cvogt / Build.scala
Created August 17, 2016 19:00
Scalable code-generation
import sbt._
import Keys._
import Tests._
object stagedBuild extends Build {
lazy val mainProject = Project(
id="main",
base=file("."),
settings = sharedSettings ++ Seq(
slick <<= codeGenTask, // register manual sbt command
@eamelink
eamelink / recursion-and-trampolines-in-scala.md
Last active April 10, 2024 15:57
Recursion and Trampolines in Scala

Recursion and Trampolines in Scala

Recursion is beautiful. As an example, let's consider this perfectly acceptable example of defining the functions even and odd in Scala, whose semantics you can guess:

def even(i: Int): Boolean = i match {
  case 0 => true
  case _ => odd(i - 1)
}

def odd(i: Int): Boolean = i match {