Add the beans to a large cast-iron lidded pan (or beanpot if you happen to have one). Roughly peel and chop the onions and carrots and add to the beans. Empty the tinned tomatoes into the pan, fill the can with water and add to the beans as well. Make sure the beans are just covered in liquid. Add the sugar, mustard, tomato purée, molasses or treacle, and red wine vinegar and season to taste.