Suppose that someone would translate this simple Python code to Haskell:
def important_astrological_calculation(di
In this case, your pidigits list is a constant (or "constant applicative form ), and GHC will probably float it out, calculate it once, and share amongst uses. If there are no references to the CAF, it will be garbage collected.
Now, in general, if you want something to be recalculated, turn it into a function (e.g. by adding a dummy ()
parameter). Examples in the linked question on CAFs: How to make a CAF not a CAF in Haskell?