Skip to content

Replacement for chimney's partial transformations #31

@arainko

Description

@arainko

I was originally not going to tackle this but I've found a really compelling use case in conjunction with newtypes that need to be validated.

It works perfectly because we can create an instance of a PartialTransformer (TransformerF from chimney) in the companion object of such a newtype for free which will make composing case classes made up of such newtypes a one liner instead of eg. (value1, value2, value3, ...).mapN(CaseClass.apply) given that a case class/method we use to transform to has the correct fields - this is especially helpful when working with generated code (eg. guardrail, smithy4s etc.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions