Skip to content

Instantly share code, notes, and snippets.

@missingfaktor
Created January 24, 2012 08:16
Show Gist options
  • Select an option

  • Save missingfaktor/1668811 to your computer and use it in GitHub Desktop.

Select an option

Save missingfaktor/1668811 to your computer and use it in GitHub Desktop.
// General.
// With this, you can abbreviate ('x : Expr[Type]) to 'x.as[Type].
implicit def symbolWithAs(s: Symbol) = new { def as[A]: Expr[A] = s }
// More specific ones, for even more brevity.
def double_(s: Symbol) = Atom[Double](s)
def int_(s: Symbol) = Atom[Int](s) // etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment