ex4.6 - flatMap implementation for Either data type