composewell / streamly

High performance, concurrent functional programming abstractions
https://streamly.composewell.com
Other
861 stars 66 forks source link

Consolidate encodeConstrNames and encodeRecordFields options into a single option #2630

Closed harendra-kumar closed 1 day ago

adithyaov commented 2 months ago

How will this work? These are two distinct options.

adithyaov commented 2 months ago

TODO: Write an example for why these options need to be distinct before closing this issue.

adithyaov commented 1 day ago

Consider,

data Record = A { f :: Int } | B { g :: String }

On encode (A 1),

Without any options: "01" With encodeConstrNames: "A1" With encodeRecordFields: "Af1"