
27 Jun
2005
27 Jun
'05
6:19 a.m.
Christian Maeder wrote:
Malcolm Wallace wrote:
Christian Maeder
writes: voidcast v@(VariantWithOne{}) = v { field1 = Void , field2 = Void } Setting field2 only assures type correctness, but the value of field2 would be ignored at runtime. Exactly what I was proposing.
I know, but how "save" is this. i.e. when you mistype/exchange field names?
The criterion should be how "robust" you can program, i.e. can you easily detect the spots that you must change (or need not to be changed) when the data type changed? (One of the advantages of Haskell's type system) Christian