Using Set: Hypergraph type

Eray Ozkural (exa) erayo@cs.bilkent.edu.tr
Tue, 4 Sep 2001 21:12:41 +0300


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi Tom,

On Tuesday 04 September 2001 09:00 pm, Tom Moertel wrote:
>     type Hypergraph a = Set (Set a)
>
>     instance Ord a => Ord (Set a) where
>         compare x y = compare (setToList x) (setToList y)
>
>     hgraph :: Ord a => [[a]] -> Hypergraph a
>     hgraph = mkSet . map mkSet
>
> Now it works as expected:
>

Thanks for the suggestion, but isn't this a bit inefficient? Ordinarily one 
would like to compare two elements of a set by reference, not by content. As 
I write in another post, it might be possible to use another type from Edison 
to reach that effect. Edison is a bit complicated, so it will take some time 
for me to figure it out.

>
> P.S.  Nice to see a fellow K5'er on the Haskell lists.  (I go my
> "tmoertel" on K5.)

Hi tmoertel! Nice to see you here :) Internet is a small place.

Sincerely,

- -- 
Eray Ozkural (exa) <erayo@cs.bilkent.edu.tr>
Comp. Sci. Dept., Bilkent University, Ankara
www: http://www.cs.bilkent.edu.tr/~erayo
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE7lRmZfAeuFodNU5wRAlAWAJ9eAy6BBPO6FpC7eGSDCJzbURWslQCcDnty
G+Dp6G+0RuJ+EaXB2uxoO2E=
=cbgu
-----END PGP SIGNATURE-----