Multiple applications of a function
Marcin 'Qrczak' Kowalczyk
16 Sep 2001 15:11:27 GMT
Sun, 16 Sep 2001 10:52:07 -0400 (EDT), Mark Carroll <email@example.com> pisze:
> To multiply apply a function, I'm currently using:
> multiplyApply f n a = (iterate f a) !! n
> ...is there a Prelude function I've missed that already does this?
> Could I be doing this better?
I think an explicit recursion would make it easier to compile
efficiently, and it can give a better error message for n < 0.
__("< Marcin Kowalczyk * firstname.lastname@example.org http://qrczak.ids.net.pl/
^^ SYGNATURA ZASTĘPCZA