Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Multiply in Type Class Questions
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Anwar Rizal  
View profile  
 More options Feb 25, 3:29 pm
From: Anwar Rizal <anriza...@gmail.com>
Date: Sat, 25 Feb 2012 21:29:59 +0100
Local: Sat, Feb 25 2012 3:29 pm
Subject: [scalaz seven] Multiply in Type Class Questions

Hi,

I notice that  in scalaz seven Monoid has multiply function, that is
implemented by calling the replicate function.

Some questions on multiply functions:

1/ If I understand correctly, if I call 3  multiply(10), then append will
be called 10 times. Is there a way to override the multiply implementation
in the a class instance. For example, in the example 3  multiply(10), I
would like to use integer multiplication instead of repetitively calling
append ?

2/ Is there any reason why multiply is not defined in Semigroup. Is it
because multiply must support 0 as the multiplication factor ? Similarly, I
wonder if it is possible to make multiply to support negative number for
Group ?

Thanks,
Anwar .


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Discussion subject changed to "[scalaz seven] Multiply in Type Class Questions" by Runar Bjarnason
Runar Bjarnason  
View profile  
 More options Feb 26, 1:06 am
From: Runar Bjarnason <runaror...@gmail.com>
Date: Sun, 26 Feb 2012 01:06:26 -0500
Local: Sun, Feb 26 2012 1:06 am
Subject: Re: [scalaz] [scalaz seven] Multiply in Type Class Questions
We should probably make it possible to override this function.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anwar Rizal  
View profile  
 More options Feb 26, 4:06 am
From: Anwar Rizal <anriza...@gmail.com>
Date: Sun, 26 Feb 2012 10:06:49 +0100
Local: Sun, Feb 26 2012 4:06 am
Subject: Re: [scalaz] [scalaz seven] Multiply in Type Class Questions

Yeah, I think so too.

I would love to have it at Semigroup (that accepts only positive
multiplier) and Group (that accepts also negative value).

Anwar.

On Sun, Feb 26, 2012 at 7:06 AM, Runar Bjarnason <runaror...@gmail.com>wrote:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Zaugg  
View profile  
 More options Feb 26, 5:11 am
From: Jason Zaugg <jza...@gmail.com>
Date: Sun, 26 Feb 2012 11:11:28 +0100
Local: Sun, Feb 26 2012 5:11 am
Subject: Re: [scalaz] [scalaz seven] Multiply in Type Class Questions

On Sun, Feb 26, 2012 at 10:06 AM, Anwar Rizal <anriza...@gmail.com> wrote:
> Yeah, I think so too.

> I would love to have it at Semigroup (that accepts only positive multiplier)
> and Group (that accepts also negative value).

> Anwar.

> On Sun, Feb 26, 2012 at 7:06 AM, Runar Bjarnason <runaror...@gmail.com>
> wrote:

>> We should probably make it possible to override this function.

That all sounds reasonable. We could make it return Option[A].

-jason


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Anwar Rizal  
View profile  
 More options Feb 26, 2:44 pm
From: Anwar Rizal <anriza...@gmail.com>
Date: Sun, 26 Feb 2012 20:44:56 +0100
Local: Sun, Feb 26 2012 2:44 pm
Subject: Re: [scalaz] [scalaz seven] Multiply in Type Class Questions

OK, I filed an issue here:  :
https://github.com/scalaz/scalaz/issues/77


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »