Am Donnerstag, 21. Februar 2008 16:58 schrieb Ben Butler-Cole:
> Hello
>
> I was surprised to be unable to find anything like this in the standard
> libraries:
>
> times :: (a -> a) -> Int -> (a -> a)
> times f 0 = id
> times f n = f . (times f (n-1))

times f n = (!! n) . iterate f

> […]

Best wishes,
Wolfgang
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to