[Haskell-cafe] Overloading

Carlos Camarao carlos.camarao at gmail.com
Tue Mar 12 19:31:02 CET 2013


On Tue, Mar 12, 2013 at 3:21 PM, Brandon Allbery <allbery.b at gmail.com>wrote:

> On Tue, Mar 12, 2013 at 1:52 PM, Carlos Camarao <carlos.camarao at gmail.com>wrote:
>
>> Sorry, I think my sentence:
>>     "To define (+) as an overloaded operator in Haskell,
>>       you have to define and use a type class."
>> is not quite correct.  I meant that to define any operator in Haskell you
>> have to
>> have a type class defined with that operator as member.
>>
>
> What? An operator is just an infix function, taken from the set of
> symbols. Any function can be an operator (and is, via `func` syntax). No
> typeclass is required to define a random operator.
>
> What did you really mean to say there?
>

Sorry, I meant: "To define any _overloaded_ name or operator (i.e. any
name/operator that can be overloaded) in Haskell you have to have a type
class defined with that name/operator as member.

Cheers,

Carlos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130312/7b15a68a/attachment.htm>


More information about the Haskell-Cafe mailing list