OPERATOR OVERLOADING AS IN C++

I'm new to functional programming, Whether it is possible to do operator overloading in Haskell ? I go through the Idea of TYPECLASSES in Learn you haskell tutorial. But I can't understand the idea Can anyone suggest me some idea regarding Operator overloading and Type classes in Haskell. Thank you guys Praveen v

On Tue, Feb 14, 2017 at 06:21:37PM +0530, Praveen Velliengiri wrote:
I'm new to functional programming, Whether it is possible to do operator overloading in Haskell ? I go through the Idea of TYPECLASSES in Learn you haskell tutorial. But I can't understand the idea Can anyone suggest me some idea regarding Operator overloading and Type classes in Haskell. Thank you guys
Hello Praveen, indeed Haskell uses typeclasses to deal with ad hoc polymorphism. Are you familiar with any of them? If I write in ghci: λ> show 707 "707" λ> show True "True" λ> show 'c' "'c'" λ> show "palla" "\"palla\"" that is possible because numerous types are instances of the typeclass Show, which provides `show` λ> :t show show :: Show a => a -> String Does that help a bit? Or you aren't sure about the typeclass syntax?
participants (2)
-
Francesco Ariis
-
Praveen Velliengiri