Who could provide information regarding START_FILE
pragma?
The is no word about START_FILE
in GHC Pragmas Documentation. Nevertheless it seems to be widely used [1], [2], [3].
Unfortunately ghc 8.2.2
does not compile following code[1].
{-# START_FILE main.hs #-}
main = readFile "file.txt" >>= putStr
{-# START_FILE file.txt #-}
Hello, world!
No, this is an extension specific to School of Haskell Markdown. It's used to provide several "files" in a single Markdown code block.
It's not "widely used" outside of School of Haskell for that reason. When reading such code snippets, simple treat everything after a START_FILE
pragma as if it was in a file with the name indicated as the parameter (if it indicates a format like BASE64
you need to put the decoded bytes into the file instead).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With