Skip to content

Instantly share code, notes, and snippets.

@hderms
Created January 31, 2020 16:27
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 hderms/3c32e919f3b1e28ce4d5674c04e7ff71 to your computer and use it in GitHub Desktop.
Save hderms/3c32e919f3b1e28ce4d5674c04e7ff71 to your computer and use it in GitHub Desktop.
chimney library hypothetical
//The input datatype that we want to 'split'
case class Input(age: Int, date: LocalDate, name: String, range: Range.Inclusive)
//wrapper A receives some of the elements that are 'split out'
case class WrapperA(age: Int, date: LocalDate)
// wrapper B retains the rest
case class WrapperB(range: Range.Inclusive, name: String)
//the output type we'd like to transform Input into
case class TransformInto(wrapperA: WrapperA, wrapperB: WrapperB)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment