showUnique

John Meacham john@repetae.net
Tue, 10 Dec 2002 19:30:23 -0800


no constraints at all, what is shown is implementation dependent, with
the only requirement being that:

u == u' iff showUnique u == showUnique u'


a string can contain an arbitrary amount of data so any internal
representation can be shown, note there is no readUnique, we need not be
able to go in the other direction. also, Ord is not maintained, just Eq.

I suppose a nice constraint would be that the string be made up of
alphanumeric values only this can be trivially done and would make it
more useful.

	John

On Wed, Dec 11, 2002 at 02:05:51PM +1100, Andrew J Bromage wrote:
> G'day all.
> 
> On Tue, Dec 10, 2002 at 06:46:27PM -0800, John Meacham wrote:
> 
> > how about adding a show instance for Unique in Data.Unique?  oftentimes
> > arbitrary unique labels need to be generated, but 'hashUnique' doesnt
> > guarentee the returned Int is unique. there is no way to add this
> > functionality outside of the Data.Unique module since Unique is opaque.
> 
> What do you propose that the show method would actually return on
> a Unique?  I think this is far from obvious, as any such method
> would break the opacity of Unique, and hence limit the number of
> ways that it could be implemented.
> 
> Cheers,
> Andrew Bromage
> _______________________________________________
> Libraries mailing list
> Libraries@haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
> 

-- 
---------------------------------------------------------------------------
John Meacham - California Institute of Technology, Alum. - john@foo.net
---------------------------------------------------------------------------