Converting binary operations into operations that work on lists