Records (was Re: [Haskell] Improvements to GHC)

David Roundy droundy at abridgegame.org
Thu Nov 24 08:56:12 EST 2005


On Wed, Nov 23, 2005 at 02:58:43PM +0100, Wolfgang Jeltsch wrote:
> Am Mittwoch, 23. November 2005 14:22 schrieb David Roundy:
> > On Tue, Nov 22, 2005 at 02:32:47PM +0000, Rob Ennals wrote:
> > [...]
> 
> > > 7. Unordered records: yep (if I understand the problem correctly)
...
> You can just omit the data constructors from the module's export list.

Yes, you can do that if you don't want to allow pattern matching.  That's
an acceptable solution for truly "exported" (i.e. opaque) data, but for
internal data structures I would like to allow pattern matching without
allowing positional matching (or constructing).  Too many times I've had to
go through the entire code adding an extra "_" to each pattern match, and
each time there's a possibility you'll add it in the wrong spot.  I could
do this with coding guidelines, but I'd prefer to have the compiler enforce
this.
-- 
David Roundy
http://www.darcs.net


More information about the Haskell mailing list