Skip to content

Instantly share code, notes, and snippets.

@searler
Created August 1, 2015 21:52
Show Gist options
  • Save searler/09f945fa6c7835f2b141 to your computer and use it in GitHub Desktop.
Save searler/09f945fa6c7835f2b141 to your computer and use it in GitHub Desktop.
Using scodec discriminated/typecase to encode subtypes
val contents: Codec[Data] = discriminated[Data].by(ignore(0))
.typecase((), empty)
.typecase((), XXX)
.typecase((), YYY)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment