[clean-list] Re: Newbie Question

RT Happe rthappe@mathematik.uni-freiburg.de
Thu, 19 Sep 2002 16:54:43 +0200 (CEST)


On Thu, 19 Sep 2002, Diederik van Arkel wrote:
> On Thursday, September 19, 2002, at 12:07 AM, Hal Daume III wrote:
>
> > I think the general solution is to report and error if passed an empty
> > list.  Otherwise, you would need to know the infimum of the type you

> Hal's suggestion is what is implemented in the StdEnv (see maxList in
> StdOrdList).
> For your version replace the int 0 by the class zero as follows:

... but think twice whether you really want max [] = zero.  This would
break monotonicity, max xs++ys would possibly be smaller than the maximum
of max xs and max ys, e.g. when xs = [-1] and ys = [].

rthappe