map(A,func)
, but that one's for arrays only. How would you go about abstracting it to different collection types like trees and hash-maps? Also is the func
just a (void *)
pointer, or does its type actually get checked when it's applied to func(A[i])
?