
Hello, I'm just starting off, but I'm wondering if anyone has any suggestions. I've made a recursive function that's goal is to handle a base raised to a very large power. modLoop :: Integer -> Integer -> Integer -> Integer -> Integer -> Integer modLoop iterator exponent result base modulus | (iterator == exponent) = result | (iterator < exponent) = modLoop (iterator + 1) (exponent) (mod (result * base) modulus) base modulus | (iterator > exponent) = (-1) However, it flat breaks or takes a long time when using large numbers. I need to get better at using strict functions, however, I compiled with ghc -o (as it tends to implement the strict version - ?) and I still have the same problem. What's a better way? Thanks in advance and thank you for your time.