Haskell function causing stack overflow

welcome to shbcf.ru