On Wed, Sep 29, 2004 at 02:43:45PM +0100, Simon Peyton-Jones wrote:
> | I meant that the implementation like
> |
> | minimum [x] = x
> | minimum (x:y:xs) = if x > y then minimum (y:xs)
> | else minimum (x:xs)
>
> It would be
| I meant that the implementation like
|
| minimum [x] = x
| minimum (x:y:xs) = if x > y then minimum (y:xs)
| else minimum (x:xs)
It would be great if this was the defn of minimum in the Report. But it
isn't.
Consider
da
On Wed, Sep 29, 2004 at 01:50:28PM +0200, Carsten Schultz wrote:
> Hi!
>
> On Wed, Sep 29, 2004 at 09:47:14AM +0400, Serge D. Mechveliani wrote:
> > Simon Marlow responds on the subject of constant space `minimum':
> >
> >
> > > In 6.4, minimum & maximum will have specialised versions for Int &
Hi!
On Wed, Sep 29, 2004 at 09:47:14AM +0400, Serge D. Mechveliani wrote:
> Simon Marlow responds on the subject of constant space `minimum':
>
>
> > In 6.4, minimum & maximum will have specialised versions for Int &
> > Integer, which will run in constant stack space. We can't do this in
> >
Carsetn
This, plus your earlier message about unfold, certainly make sense. But
with the rules below, there's a danger that long literal lists would
give rise to a huge nest of cons/build rule firings, which are
ultimately all undone again. So I'm a bit cautious about building these
rules in.
B