https://devhubby.com/thread/how-to-return-an-integral-in-haskell.