softwaremill / magnolia

Easy, fast, transparent generic derivation of typeclass instances
https://softwaremill.com/open-source/
Apache License 2.0
764 stars 116 forks source link

Add isSingletonCasesEnum flag #457

Open sake92 opened 1 year ago

sake92 commented 1 year ago

It is useful to disambiguate between "singleton cases"/simple enums and ADTs.

My concrete use case was JSON serialization:

Implementation-wise, the official docs say that only "singleton cases" enums will have a values method.

adamw commented 1 year ago

Thanks - this isn't binary-compatible, but there's a scala3-v2 branch that can accept these changes :)

sake92 commented 1 year ago

Thanks @adamw !
Do those artifacts get published too?

adamw commented 1 year ago

Not yet - but we'll get there eventually :)