Re: Beginners Digest, Vol 104, Issue 9

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: Beginners Digest, Vol 104, Issue 9

Praveen Velliengiri
Thanks a lot.馃檪

On 15 February 2017 at 17:30, <[hidden email]> wrote:
Send Beginners mailing list submissions to
聽 聽 聽 聽 [hidden email]

To subscribe or unsubscribe via the World Wide Web, visit
聽 聽 聽 聽 http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
or, via email, send a message with subject or body 'help' to
聽 聽 聽 聽 [hidden email]

You can reach the person managing the list at
聽 聽 聽 聽 [hidden email]

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Beginners digest..."


Today's Topics:

聽 聽1.聽 OPERATOR OVERLOADING AS IN C++ (Praveen Velliengiri)
聽 聽2. Re:聽 OPERATOR OVERLOADING AS IN C++ (Francesco Ariis)


----------------------------------------------------------------------

Message: 1
Date: Tue, 14 Feb 2017 18:21:37 +0530
From: Praveen Velliengiri <[hidden email]>
To: [hidden email]
Subject: [Haskell-beginners] OPERATOR OVERLOADING AS IN C++
Message-ID:
聽 聽 聽 聽 <CAL56b7SMDdF+doiqyLxTM85Tgv+R=[hidden email]>
Content-Type: text/plain; charset="utf-8"

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20170214/ef255a81/attachment-0001.html>

------------------------------

Message: 2
Date: Tue, 14 Feb 2017 14:18:19 +0100
From: Francesco Ariis <[hidden email]>
To: [hidden email]
Subject: Re: [Haskell-beginners] OPERATOR OVERLOADING AS IN C++
Message-ID: <20170214131819.GA3107@casa.casa>
Content-Type: text/plain; charset=utf-8

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?


------------------------------

Subject: Digest Footer

_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners


------------------------------

End of Beginners Digest, Vol 104, Issue 9
*****************************************


_______________________________________________
Beginners mailing list
[hidden email]
http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners