effect
                                
                                 effect copied to clipboard
                                
                                    effect copied to clipboard
                            
                            
                            
                        S.Class parity with S.struct for S.omit, S.union possible?
What is the problem this feature would solve?
I'm weighting the switch from S.struct to S.Class due to all the added comforts. Some questions I couldn't answer myself with quick search in the documentation:
- can class/schema A extend class/schema B while skipping some fields?
- is it possible (at all) to have Class that's also a discriminating union?
- overall, the interop between S.Class and S.struct is unclear to me — can I reuse any of the existing schemas when declaring classes? is there gradual upgrade path or do I need to switch to S.Class everywhere?
What is the feature you are proposing to solve the problem?
better explanation of the S.class and S.struct interop as well as upgrade or migration path(s)
What alternatives have you considered?
none
- it would not be an extension as the new class type would not extend the previous structurally, I can't find anything to do it at the moment but I guess it would be possible when exposing fields(related to https://github.com/Effect-TS/effect/issues/2014)
- no, in TS classes cannot represent unions. You'd need something like MyUnion({ actualUnion: ... })so basically a type wrapper
- schemas are schemas, regardless of how they are created, so you can use existing schemas as fields of your classes