On Mon, Oct 1, 2012 at 7:16 PM, Brian Knapp <
knap...@gmail.com> wrote:
> I'd like to implement a versions then. I'm interested in maximizing
> performance headroom for a traversal problem that justifies the functional
> style.
>
> It seems like all I need is:
> cmap (fun, iterable)
>
> At first glance I'm thinking using a function pointer and a typed memory
> view for iterable is a good solution. However it's unclear that cymap would
> not need to know fun's signature and the type of elements in the view. Is
> there a potential compiler problem (many execution paths) for a general
> implementation of the proposed cmap?
Yes, you would need to explicitly specify the type (which could be a
fused type). However, it's unclear you need to write such a generic
framework. Also raw pointers are a pain in C as they cannot enclose
any state (like a closure), which is usually solved in C by also
passing a void* data member. I would verify that your bottleneck lies
here before going this route.