converted problem 27's disjoint sets function from list comprehension form to monadic do-notation form for better readability, and to try to help figure out how to solve problem 27 part b; narrow module imports