Darryl Miles
12/02/2024, 12:40 PMFirstType | SecondType | ErrorType
so that for example a swagger/OpenAPI/REST highlevel client side API can support decoding the response payload and hydrating a concrete class type from a known-ahead-of-time list of possible classes.
The Either[] pattern of category theory is good for the error-channel use case.
FWIW ideally I would like the top level API to be scriptable (if needed) to manage sugaring the interface so it just works with duck typing, but the implementation below does not need to be like this, the whole point is the API the user consumes hides verbose boilerplate constructs. So I am just trying to evaluation options for the cross over between.
At the moment I have Tuple() like arrangement: return Triple(o as? FirstType, o as? SecondType, errorType)
so am expecting to manage this at the scripting layer.
So the question is "are there any useful constructs within Arrow to consider in this area of Union types?" a single return value that can be one of a fixed list of known types.Alejandro Serrano.Mena
12/02/2024, 3:38 PMAlejandro Serrano.Mena
12/02/2024, 3:39 PMDarryl Miles
12/02/2024, 6:21 PM