Skip to content

Instantly share code, notes, and snippets.

View tpolecat's full-sized avatar
🔥
Dijkstra would not have liked this.

Rob Norris tpolecat

🔥
Dijkstra would not have liked this.
View GitHub Profile
@travisbrown
travisbrown / FreeMacros.scala
Last active December 13, 2015 10:55
Quick sketch of a not very general implementation of boilerplate-free coyoneda'd constructors
import scala.language.experimental.macros
import scala.reflect.macros.whitebox
class FreeMacros(val c: whitebox.Context) {
import c.universe._
def smartName(name: String): String = (
name.toList match {
case h :: t => h.toLower :: t
case Nil => Nil