Re: Doing exercises from Haskell tutorial ...
MK 02 Oct 2001 15:16:27 +0300, Dmitry Astapov [EMAIL PROTECTED] pisze: I need to define SetsAsLists as an instance of Set by supplying definitions for all Set methods, but definitions I wrote led me to adding additional constraints on union and memeber methods. MK What constraints? The class already says that these operations require MK Eq on the element type: [skip] Yes, they already there, but only because I placed them there. Original text from Tutorial does not have these constraints. -- Dmitry Astapov //ADEpt E-mail: [EMAIL PROTECTED] GPG KeyID/fprint: F5D7639D/CA36 E6C4 815D 434D 0498 2B08 7867 4860 F5D7 639D ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe
Re: Doing exercises from Haskell tutorial ...
02 Oct 2001 15:16:27 +0300, Dmitry Astapov [EMAIL PROTECTED] pisze: I need to define SetsAsLists as an instance of Set by supplying definitions for all Set methods, but definitions I wrote led me to adding additional constraints on union and memeber methods. What constraints? The class already says that these operations require Eq on the element type: class Set s where empty :: s a isEmpty :: s a - Bool singleton :: a - s a union :: Eq a = s a - s a - s a member :: Eq a = a - s a - Bool choice :: s a - (a, s a) -- __( Marcin Kowalczyk * [EMAIL PROTECTED] http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTÊPCZA QRCZAK ___ Haskell-Cafe mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell-cafe