foldr and map and curry, a function c preprocessor