

On Fri, 11 Oct 2002 Fergus Henderson wrote :
>On 11-Oct-2002, Noel  Pinto <cool4life@rediffmail.com> wrote:
> > I have a query regarding Type classes.
> >
> > I want to know how to use type classes. I have tried writing 
>the
> > code by looking at the example in the manuals, but still it
> > gives me errors.
>
>Type classes can be used for cases where you would like a single 
>interface
>that you want to implement in different ways for different 
>types.
>
> > I want to write a code to take a number, square it and 
>display
> > it on the screen.
>
>It's not clear why you would want to use type classes for this.
>Type classes generally only make sense when you have, well,
>at least two types that you want to do something similar with.
>

I wanted to just see how would a Type Class work in a fully 
functional code. Plz do help me understand it better. Could you 
frame an example for me.

Thanks.

Regards,

Noel
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users@cs.mu.oz.au
administrative address: owner-mercury-users@cs.mu.oz.au
unsubscribe: Address: mercury-users-request@cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request@cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------

