Skip to content

Instantly share code, notes, and snippets.

@tixxit
Created April 9, 2013 00:46
Show Gist options
  • Select an option

  • Save tixxit/5341962 to your computer and use it in GitHub Desktop.

Select an option

Save tixxit/5341962 to your computer and use it in GitHub Desktop.
def seq[A: c.WeakTypeTag](c: Context)(es: List[c.Expr[A]]): c.Expr[List[A]] = {
import c.universe._
val ident = Ident(weakTypeTag[A].tpe.typeSymbol)
c.Expr(Apply(TypeApply(Select(Select(This(newTypeName("immutable")), newTermName("List")), newTermName("apply")), List(ident)), es map (_.tree)))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment