Skip to content

Instantly share code, notes, and snippets.

@arturaz
Created February 21, 2013 19:53
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 arturaz/5007609 to your computer and use it in GitHub Desktop.
Save arturaz/5007609 to your computer and use it in GitHub Desktop.
case class ViewRow[K, V, D](id: String, key: K, value: V, doc: Option[D])
def viewRowFormat[K : Format, V : Format, D : Format] = (
(__ \ 'id).format[String] ~
(__ \ 'key).format[K] ~
(__ \ 'value).format[V] ~
(__ \ 'doc).formatNullable[D]
).apply(ViewRow.apply, unlift(ViewRow.unapply[K, V, D]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment