adl icon indicating copy to clipboard operation
adl copied to clipboard

Addition of java records and semi sumtype support?

Open gurgl opened this issue 9 months ago • 1 comments

Hey

This is a package I hoped existed but just found out about. Could possibly use this to achieve java-haskell interop. Tested the java serialization. I noticed it lacked record and the sealed-interface+record trick to achieve sum types.

I wonder if you'd accept a PR that provides support for the 2 above features? Either by use of flags or by default.

gurgl avatar Mar 20 '25 20:03 gurgl

Yes - I would accept a PR, though it would need to be behind a flag to continue to support the current behavior.

Or, possibly, it could be behind an annotation to control this feature on per declaration or per module basis.

sealed-interface+record trick to achieve sum types.

I would likely have used this approach, if it existed when the java codegen was written.

timbod7 avatar Mar 20 '25 22:03 timbod7