[Haskell-cafe] Re: Is "take" behaving correctly?

Neil Mitchell ndmitchell at gmail.com
Wed Sep 12 12:01:21 EDT 2007


> A more serious point is that in some cases we might want take to
> underapproximate, or zip to truncate (or tail [] = [] ?). I don't
> think there's
> always a clear "library" choice here.

I have a zipWithEq function I often use, which crashes if the zip'd
lists aren't equal. I also have tailSafe which does the tailSafe [] =
[] behaviour. I created a hackage package "safe" for the tailSafe
function and others, http://www-users.cs.york.ac.uk/~ndm/safe/ . If
anyone wants to extend that with deliberately unsafe functions, such
as zipWithUnsafe, zipUnsafe, takeUnsafe etc, I'd be happy to accept a
patch. If not, I'll probably do it myself at some point in the
(potentially distant) future.



More information about the Haskell-Cafe mailing list