News for hackers. Stuff that matters.
Re:Once you go functional, you can never go back by okasaki on Monday May 18, 2015 @09:55AM (#9564404)
No idea why the author thinks it's impossible. I mean, C stdlib comes with qsort.

Here's a map in C

    void *map(void *in, void (*f)(void *src, void *dst), size_t size, size_t in_s, size_t out_s)
    {
        void *out = malloc(size * out_s);
    
        for(size_t i = 0; i < size; i++)
            f(in + (i * in_s), out + (i * out_s));
    
        return out;
    }

There are no comments on this comment yet.