[m-dev.] for review: use bitsets in quantification

Ralph Becket rbeck at microsoft.com
Fri Nov 10 21:52:44 AEDT 2000


>From Fergus Henderson on 10/11/2000 06:30:11
> 
> I'm happy with the design, but I object to the use of the name `enum'.
> That name should be reserved for something that is actually enumerable,
IMHO.
> 
> I suggest we use a different name, e.g. `reversible_hash'.
> 
> (Any other suggestions for a good name for this type class?)

`reversible_hash' seems fine, but it seems to me that it should be a
subclass of `hash':

:- typeclass hashable(T) where [
	func hash(T) = int
].

:- typeclass reversibly_hashable(T) <= hashable(T) where [
		% reverse_hash(H) = X  <=>  H = hash(X)
		% Raises an error if H is not the hash of some X.
		%
	func reverse_hash(int) = T
].

Of course, now we can have the naming argument again.

--
Ralph Becket      |      MSR Cambridge      |      rbeck at microsoft.com 

--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list