-- | Get neighbours of a Point in a Set.
neighboursOf :: Int -> Int -> Point -> Set Point
neighboursOf w h (r, c) = Set.filter (`member` gridPs) possibleNeighbours
    where gridPs             = fromList $ gridPoints w h
          possibleNeighbours = fromList [(r, c - 1), (r, c + 1),
                                         (r + 1, c), (r + 1, c + 1), (r + 1, c - 1),
                                         (r - 1, c), (r - 1, c + 1), (r - 1, c - 1)]
neighboursOf :: Int -> Int -> Point -> Set Point
neighboursOf w h (r, c) = Set.filter (`member` gridPs) possibleNeighbours
    where gridPs             = fromList $ gridPoints w h
          possibleNeighbours = fromList [(r, c - 1), (r, c + 1),
                                         (r + 1, c), (r + 1, c + 1), (r + 1, c - 1),
                                         (r - 1, c), (r - 1, c + 1), (r - 1, c - 1)]
neighboursOf w h (r, c) = Set.filter (`member` gridPs) possibleNeighbours
    where gridPs             = fromList $ gridPoints w h
          possibleNeighbours = fromList [(r, c - 1), (r, c + 1),
                                         (r + 1, c), (r + 1, c + 1), (r + 1, c - 1),
                                         (r - 1, c), (r - 1, c + 1), (r - 1, c - 1)]