develooper Front page | perl.perl6.language | Postings from May 2005

Re: reduce metaoperator on an empty list

Thread Previous | Thread Next
From:
Matt Fowles
Date:
May 20, 2005 21:46
Subject:
Re: reduce metaoperator on an empty list
Message ID:
f2601a7f050520214522ee010e@mail.gmail.com
Mark~

On 5/20/05, mark.a.biggar@comcast.net <mark.a.biggar@comcast.net> wrote:
> 
> > Mark A. Biggar wrote:
> > > Well the identity of % is +inf (also right side only).
> >
> > I read $n % any( $n..Inf ) == $n. The point is there's no
> > unique right identity and thus (Num,%) disqualifies for a
> > Monoid. BTW, the above is a nice example where a junction
> > needn't be preserved :)
> 
> If as usual the definition of a right identity value e is that a op e = a for all a,
> then only +inf works.  Besdies you example should have been;
> $n % any (($n+1)..Inf),  $n % $n = 0.
> 
> > > E.g. if X<Y is left associative and  returns Y when true then ...
> >
> > Sorry, is it the case that $x = $y < $z might put something else
> > but 0 or 1 into $x depending on the order relation between $y and $z?
> 
> Which is one reason why I siad that it might not make sense to define the chaining ops in terms of the associtivity of the binary ops,  But as we are interested in what [<] over the empty list shoud return , the identity (left or right) of '<' is unimportant as I think that should return false as there is nothing to be less then anything else.  Note that defaulting to undef therefore works in that case.

On the contrary a mathematician would say that the empty list is
monotonically increasing (vacuously) and the answer should be true.

Matt
-- 
"Computer Science is merely the post-Turing Decline of Formal Systems Theory."
-???

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About