[Haskell-cafe] Re: more functions to evaluate

Aaron Denney wnoise at ofb.net
Sat Oct 13 03:56:34 EDT 2007


On 2007-10-12, Dan Weston <westondan at imageworks.com> wrote:
> applyNtimes f n | n > 0     = f . applyNtimes f (n-1)
>                 | otherwise = id

Why not some variant of:

applyNtimes f n = foldl' (.) id (replicate n f)

-- 
Aaron Denney
-><-



More information about the Haskell-Cafe mailing list