renamed mapM and foldM to map_m and fold_m