Skip to content

What if my encoder/decoder/codec depends on some configuration options, am I forced to manually wire up? #145

Open
@DamianReeves

Description

@DamianReeves

I have types that must target multiple versions of a target JSON format, and I am wondering if I can use Fleece without being forced to drop down to using combinators to manually wire things together.

Lets say I have the following:

type Name = Name of Parts: string list
   member ToJson (options:MorphirJsonFormatOptions) = failwith "TODO: encode using options"
and MorphirJsonFormatOptions =
| Classic of Version:int
| NextGen of NextGenVersionOptions
and NextGenVersionOptions =  {Version:Version ; NameEncodingMode: NameEncodingMode}
and Version = Version of Major:int * Minor:int * Patch:int
and NameEncodingMode =
| ArrayStyle
| SnakeCasedSymbol

Are there any recommendations how I can still benefit from the SRTP resolution?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions