This code doesn't work in ghc 9.0.1:
echo 'main = print 123' > f runghc -x hs f
Try it online in ghc 8.2.2.