Skip to content

Instantly share code, notes, and snippets.

@lichenbo
Created May 6, 2013 11:52
Show Gist options
  • Save lichenbo/5524702 to your computer and use it in GitHub Desktop.
Save lichenbo/5524702 to your computer and use it in GitHub Desktop.
list_t * map (void * (*f)(void*, void*), void* env, list_t* xs) {
if (xs == NULL)
return NULL;
return makelist(f(env, xs->head), map(f, env, xs->tail));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment