[Haskell-cafe] Re: Why 'round' does not just round numbers ?

Achim Schneider barsoap at web.de
Tue Oct 28 00:53:16 EDT 2008

Daniel Fischer <daniel.is.fischer at web.de> wrote:

> Am Montag, 27. Oktober 2008 13:34 schrieb Achim Schneider:
> > >
> > > Who does such horrible things?
> > > Repeat after me: 1 is NOT a prime. Never, under no circumstances.
> >
> > Then chase it out of your prime factor products. You'd be the first
> > one to break a monoid and locate unsafeCalculate#.
> Huh? I don't understand what you are trying to say here. 
> In which way do you use the term "prime factor product"?
> If you're referring the value of the product, 1 is a perfectly
> legitimate value, that of the empty product.
> If you're referring the expression \prod_{i \in I}p_i, that doesn't
> contain 1. So out of where shall "it" (I think that refers to 1, does
> it?) be chased? And what has that to do with breaking monoids?
I am referring to 

n = product [primeFactors n]

and the fact that

product = foldr (*) 1

or even, less haskellish,

product xs = product 1:xs

(c) this sig last receiving data processing entity. Inspect headers
for copyright history. All rights reserved. Copying, hiring, renting,
performance and/or quoting of this signature prohibited.

More information about the Haskell-Cafe mailing list