Created
September 5, 2013 10:19
-
-
Save milessabin/6448380 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def as[B] = new AsAux[B].apply | |
class AsAux[B] { | |
def apply[C](implicit gen: Generic.Aux[B, C], ev: A =:= C): Codec[B] = Codec.xmap(this)(gen.from, gen.to(_)) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment