Sun, 16 Sep 2001 10:52:07 -0400 (EDT), Mark Carroll <[EMAIL PROTECTED]> 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?

Unfortunately not.

> 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 * [EMAIL PROTECTED] http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZAST�PCZA
QRCZAK


_______________________________________________
Haskell-Cafe mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to