[Haskell-cafe] Re: Type classes
Max Vasin
max-appolo at mail.ru
Mon Mar 20 10:18:43 EST 2006
>>>>> "Geest," == Geest, G van den <G.vandenGeest at students.uu.nl> writes:
Geest,> I suppose you want to define compareEntries like this:
>> compareEntries (Entry x) (Entry y) = compareEntries x y
Geest,> An option is to just implement it the following way
Geest,> (Haskell98!):
>> class DatabaseEntry e where entryLabel :: e -> String formatEntry
>> :: e -> String compareEntries :: e -> e -> Ordering
>>
>> data Entry a = Entry a
No. I don't want that. The database parsing function returns
Map.Map String Entry but entries can of different types (and
these type vary over styles).
--
WBR,
Max Vasin.
More information about the Haskell-Cafe
mailing list