
David Virebayre wrote:
I'm not sure you read his post entirely.
Here's his and function :
(and) c1 c2 = Contract { currency = undefined, payments = undefined, contracts = [c1, c2] }
Notice how he's setting currency and payments to undefined, since he needs only the contracts field for subcontracts.
Ah, right, I didn't notice that. Not a good idea. Your design is better then. Another possibility would be Maybe Currency and Maybe Double. That often comes out simpler - but not always. If the case with Currency and Payments is a totally separate case than when there are subcontracts, with different logic, then David's design is best. If the cases are usually handled pretty much in the same way with special handling for when one or more fields is missing, then Maybe is best. -Yitz