Newsgroups: comp.lang.functional
From: Albert Lai <tre...@vex.net>
Date: 14 Dec 2003 18:21:11 -0500
Local: Sun, Dec 14 2003 6:21 pm
Subject: Re: Offering abstract data structures (with simple and efficient implementation)
Joachim Durchholz <joachim.durchh...@web.de> writes: Map "is a subtype" of set, in the exact same sense that pair "is a > On your treatment of Maps: they don't just share properties with Sets, > they /are/ sets (in a "is a proper subtype" sense), namely (please > forgive my rusty Haskell) > Map a b = Set (Pair a b) > (the set of pairs from a domain and a codomain, aka the set of > key-value pairs). This implies multi-parameter type classes. subtype" of set: Pair a b = Set (Either a (Set (Either a b))) These "is-a" relations simply give one way of implementing maps and (x,y)=(a,b) iff x=a and y=b is infinitely more readable, useful, and to the point than any Furthermore, sets are not always more primitive, and maps are not A specification for maps, whether in the form of a bunch of axioms The reason explained below may or may not be a good reason to say maps > Here's why I advocate this model: What are the unfortunate consequences for equality? > The alternative model that one would come up with was used in the > abstract Eiffel class TABLE (equivalent to your Map): a set of "keys", > with additional functions for mapping these keys to associated values. > This approach, while untuitive, has very unfortunate consequences for > equality. Are they general shortcomings of all abstract axiomatizations of You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||