I can configure the maximum stack size of a GHC compiled Haskell program by passing +RTS -Kn
to it, where n
is some number.
Is there a way to change this setting from within the program?
(I’d like to benchmark stack consumption of various functions, and hence try to run it with various limits, catching the StackOverflow
exception.)