f :: Int -> a -> a
foo :: Int -> Int -> a -> a
foo i0 n = foldl1 (.) . fmap f . take n $ [i0..]
let a = foo 1 2 a0
let b = f 3 . f 2 . f 1 $ a0
Hi,
Most likely, Accelerate will never support arrays of functions —- this goes against the design philosophy of data-parallelism, where we want to apply the same function to each element of an array.
Still, it may be possible to do what you want. Here is an example where I do something like what you propose above. It is not generating an array of functions, rather it just builds up a chain of operations to execute (which sounds more like what you want, actually).
Does that help?
-Trevor
--
You received this message because you are subscribed to the Google Groups "Accelerate" group.
To unsubscribe from this group and stop receiving emails from it, send an email to accelerate-hask...@googlegroups.com.
Visit this group at https://groups.google.com/group/accelerate-haskell.
For more options, visit https://groups.google.com/d/optout.