Determining if a set of 2d vectors is a valid function
To start, if y == y1 then True else False can be simplified to y == y1:

valid' (((x,y),(x1,y1)):xs) = valid' xs &amp;&amp; if x == x1 then y == y1 else True