How do I make a Constant Applicative Form into, well, not a Constant Applicative Form, to stop it being retained for the lifetime of the program?
I\'ve tried this ap
The simplest possible solution might be to tell the compiler to inline it. (Note: this answer is untested. If it doesn't work, please comment below.)
Even if (hypothetically) the compiler refuses to inline it for some reason, you can use cpp instead, by #defining it:
#define twoTrues (map (++ (True : repeat False)) . trueBlock <$> [1..])
(although with that approach, of course, it won't appear in the module's interface, so you can only use it within that module).
The -cpp option tells GHC to preprocess the input file with cpp.
Inlining would mean duplicating the code n times if you refer to twoTrues in n>1 places. However, while that's theoretically undesirable, it's probably not going to be a significant problem in practice.