I can figure out what most literals represent with ppr, e.g. WordPrimL 7 = 7##, CharPrimL 'x' = 'x'#, etc. The only constructor I can't figure out is BytesPrimL:
λ> bytes <- mallocForeignPtrArray @Word8 5
λ> let bytesLit = LitE (BytesPrimL (mkBytes bytes 0 5)
λ> ppr bytesLit
"<binary data>"
So, what code would generate an Exp with a BytesPrimL constructor? What is it supposed to represent?
Incorrect, see edit below:
I'm pretty sure there is no Haskell code that corresponds to that. Instead, this is piggy-backing on the way GHC already compiles string literals to allow you to embed arbitrary binary data in the executable efficiently.
Edit:
It turns out there is a literal for that, when
-XMagicHashis enabled.