[Haskell-cafe] programming style...and type classes...

Nicholls, Mark nicholls.mark at vimn.com
Fri Nov 4 14:06:18 UTC 2016

>Subject: Re: [Haskell-cafe] programming style...and type classes...
>My rule of thumb is that if there is one obvious instance (or none) for every
>given type, then your abstraction is a good candidate for a typeclass; if multiple
>instances make sense, then it's a judgment call; and if many instances could
>arbitrarily make sense or not depending on the usage / circumstances, then it's
>probably not a good candidate for a typeclass.

OK, that’s a bit more prescriptive...so if many instances make sense (Ord a) then what?

Seems like Ord is a "bad" typeclass?...it should really be a dictionary data type? And then you simply define which order you want?

There needs to be 1 (or 0) instances because this is all resolved compile time?....i.e. so we (the programmer/compiler) need a function from types, and function name into instances...if there 0 instance...then boom...not defined..so you need to do something, that’s fixable....if 2...then boom...you're in trouble?

This e-mail (and any attached files) is confidential and protected by copyright (and other intellectual property rights). If you are not the intended recipient please e-mail the sender and then delete the email and any attached files immediately. Any further use or dissemination is prohibited.

While MTV Networks Europe has taken steps to ensure that this email and any attachments are virus free, it is your responsibility to ensure that this message and any attachments are virus free and do not affect your systems / data.

Communicating by email is not 100% secure and carries risks such as delay, data corruption, non-delivery, wrongful interception and unauthorised amendment. If you communicate with us by e-mail, you acknowledge and assume these risks, and you agree to take appropriate measures to minimise these risks when e-mailing us.

MTV Networks International, MTV Networks UK & Ireland, Greenhouse, Nickelodeon Viacom Consumer Products, VBSi, Viacom Brand Solutions International, Be Viacom, Viacom International Media Networks and VIMN and Comedy Central are all trading names of MTV Networks Europe.  MTV Networks Europe is a partnership between MTV Networks Europe Inc. and Viacom Networks Europe Inc.  Address for service in Great Britain is 17-29 Hawley Crescent, London, NW1 8TT.

More information about the Haskell-Cafe mailing list