Using Set: Hypergraph type

Daan Leijen daan@cs.uu.nl
Tue, 4 Sep 2001 16:27:44 +0200


Hi Eray,

> Hypergraph> :type hgraph [ [1,2], [1] ]
> forall a. (Num a, Ord (Set a), Ord a) => Set (Set a)
> Hypergraph> elementOf (mkSet [1]) (hgraph [ [1,2], [1] ])
> [type errors]


Unfortunately, you don't show the type error that
was returned. However, I think that Hugs/GHCi
is unable to figure out which numeric (Num a)
instance you are using (Int,Integer, Double??).
You can help the interpreter a little bit by
providing a type annotation:

> elementOf (mkSet [(1::Int)]) (hgraph [ [1,2], [1] ])

or a constant with a type signature

> list1 :: [Int]
> list1  = [1]
>
> test =  elementOf (mkSet list1) (hgraph [ [1,2], [1] ])


I hope this helps,
    Daan.


>
> Any help would be greatly appreciated.
>
> Regards,
>
> - --
> 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
>
> iD8DBQE7lKVDfAeuFodNU5wRAtslAJ9Hc9gIo/f+u0HWT8YlJxSOhlg2cgCeKQaj
> nj0LOmWB6PyI4m/f6adVMeM=
> =A7m7
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe@haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>