[Haskell-cafe] Overloading

Brandon Allbery allbery.b at gmail.com
Tue Mar 12 19:21:05 CET 2013


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?

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130312/50fc7ed2/attachment.htm>


More information about the Haskell-Cafe mailing list