instance Ord FiniteMap

Simon Marlow simonmar@microsoft.com
Wed, 29 May 2002 16:13:55 +0100


I'll happily incorporate the code if someone sends me a patch...

Cheers,
	Simon

> -----Original Message-----
> From: Hal Daume III [mailto:hdaume@ISI.EDU]=20
> Sent: 29 May 2002 15:03
> To: Johannes Waldmann
> Cc: GHC Users Mailing List
> Subject: Re: instance Ord FiniteMap
>=20
>=20
> I agree; the problem is that I fear that making my own=20
> instance by using
> setToList will be very inefficient (or at least much more so than an
> instance which actually looks at the tree structure).
>=20
> --
> Hal Daume III
>=20
>  "Computer science is no more about computers    | hdaume@isi.edu
>   than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
>=20
> On Wed, 29 May 2002, Johannes Waldmann wrote:
>=20
> > > for instance, Sets of Sets of things would be really nice.
> >=20
> > Sure. One could simply use lexicographic ordering
> > (i. e.  s1 `compare` s2 =3D setToList s1 `compare` setToList s2)
> > or length-lexicographic ordering (for efficiency)
> >  ... =3D (cardinality s1, setToList s1) `compare`=20
> (cardinality s2, setToList s2)
> >=20
> > As you write, there seems to be no reason not to do this.
> > An Ord instance should be a linear ordering, and the above are.
> > --=20
> > -- Johannes Waldmann ----=20
> http://www.informatik.uni-leipzig.de/~joe/ --
> > --=20
> joe@informatik.uni-leipzig.de -- phone/fax (+49) 341 9732 204/252 --
> >=20
>=20
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users@haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>=20