generatePairs :: (t1 -> (t, t1)) -> t1 -> [(t, t1)]
generatePairs f g = h:t
    where
    h@(_, g1) = f g
    t = generatePairs f g1
generatePairs :: (t1 -> (t, t1)) -> t1 -> [(t, t1)]
generatePairs f g = h:t
    where
    h@(_, g1) = f g
    t = generatePairs f g1
generatePairs f g = h:t
    where
    h@(_, g1) = f g
    t = generatePairs f g1