However, be aware that aFields, bFields and cFields are now partial functions that will crash when applied to the wrong constructor. Not a-okay in my book.
Erik On Wed, Mar 14, 2012 at 02:24, John Meacham <[email protected]> wrote: > Why not > > data Super > = SuperA { > commonFields :: () > aFields :: () > } > | SuperB { > commonFields :: () > bFields :: () > } > | SuperC { > commonFields :: () > cFields :: () > } > > reusing the common field names between constructors like this is a-okay. > > John > > _______________________________________________ > Haskell-Cafe mailing list > [email protected] > http://www.haskell.org/mailman/listinfo/haskell-cafe _______________________________________________ Haskell-Cafe mailing list [email protected] http://www.haskell.org/mailman/listinfo/haskell-cafe
