gen = unfoldt phi
  where
    phi n = if n <= 0 then Left n else Right (n-1, n-1)
gen = unfoldt phi
  where
    phi n = if n <= 0 then Left n else Right (n-1, n-1)
gen = unfoldt phi
  where
    phi n = if n <= 0 then Left n else Right (n-1, n-1)