Implement fromListWith and fromListWithKey