Skip to content

Instantly share code, notes, and snippets.

@afsalthaj
Created June 29, 2018 06:50
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 afsalthaj/334fe6c8841721540bb719c8cdffd66f to your computer and use it in GitHub Desktop.
Save afsalthaj/334fe6c8841721540bb719c8cdffd66f to your computer and use it in GitHub Desktop.
trait DecodeJson[A] {
def fromJson(a: Json): A
def map[B](f: A => B): DecodeJson[B] = new DecodeJson[B] {
def fromJson(a: Json): B = f(self.fromJson(a))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment