On 31-Mar-2000, S.D.Mechveliani <[EMAIL PROTECTED]> wrote:
>
> Now, what should Prelude.take
> think of Prelude.take (-1) (x:y:z:xs),
>
> how could it decide to display x ?
> The compiler does not know whether show x
> would lead to the infinite printing.
>
> Example: take (-1) (x,"a","b","c") where x = 'a':x
That's a bad example, since it is not type-correct.
I presume you meant
take (-1) [x,"a","b","c"] where x = 'a':x
In that case, I would recommend that the implementation
display the second argument to take as
[a, "a", "b", "c"] where a = 'a':a
> I wonder whether this is possible.
Yes, it is possible.
--
Fergus Henderson <[EMAIL PROTECTED]> | "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh> | of excellence is a lethal habit"
PGP: finger [EMAIL PROTECTED] | -- the last words of T. S. Garp.