Christian Maeder wrote: > Malcolm Wallace wrote: >>Christian Maeder <[EMAIL PROTECTED]> 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 _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe