Stern-brocot sequence in Haskell