'any' and 'all' compared with the rest of the Report
Hannah Schroeter
uk1o@rz.uni-karlsruhe.de
Tue, 23 Jan 2001 23:25:16 +0100
Hello!
On Tue, Jan 23, 2001 at 11:10:53PM +0100, Sven Panne wrote:
> [...]
> <TotallyUnbiasedAd>
> Given
>
> or = foldr (||) False
> any p = or . map p
> ghc -O generates basically the following code (use -ddump-simpl to
> see this):
> any :: (a -> Bool) -> [a] -> Bool
> any p xs = let go ys = case ys of
> (z:zs) -> case p z of
> False -> go zs
> True -> True
> in go xs
Mental note: I should really upgrade GHC. I'm however a bit afraid about
ghc-current, as I'm on a non-ELF arch.
> [...]
Kind regards,
Hannah.