Skip to content

Instantly share code, notes, and snippets.

@tstone
Created July 31, 2014 14:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tstone/115ccd732443e7b3e252 to your computer and use it in GitHub Desktop.
Save tstone/115ccd732443e7b3e252 to your computer and use it in GitHub Desktop.
// long-hand boilerplate:
case class ExampleParams(foo: String, bar: String, baz: String) extends Params {
def withFoo(value: String) = this.copy(foo = value)
def withBar(value: String) = this.copy(bar = value)
def withBaz(value: String) = this.copy(baz = value)
}
// with a macro:
param class ExampleParams(foo: String, bar: String, baz: String)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment