There might be a way to do it, I don't know, but this sounds like an XY problem. Can I ask what you're trying to achieve by doing this, or is it just out of curiosity regarding how much garbage is created? (It's a lot, by the way. Since the only thing a purely functional program can do is create data and read data (as opposed to create, read and update in an impure program) I imagine a purely functional program without GC would hit OOM very, very quickly.)