[Haskell-cafe] ANN: Data.Stream 0.4
wss at Cs.Nott.AC.UK
Fri Oct 23 06:47:07 EDT 2009
> 1) What's the difference between your:
> "tail ~(Cons _ xs) = xs"
> and the more simple:
> "tailStrict (Cons _ xs) = xs" ?
I'm no expert - but I can't think of any difference at all.
> 2) Why don't you also use an irrefutable pattern in "take"? "take" is
> now defined as:
This is a trickier question: should "take 0 undefined" by  or
undefined? I'm not sure what the best choice is. I suppose it makes
sense to stick with the behaviour of Data.List and return an empty
list, even if any program that relies on this not being undefined is
probably broken. I've uploaded a new version.
Thanks for your comments!
More information about the Haskell-Cafe