shawwn / wiki

Research wiki
https://www.shawwn.com
51 stars 8 forks source link

Don't use unsafePerformIO #1

Open puffnfresh opened 5 years ago

singpolyma commented 5 years ago

While this is very likely what you want in the current case, since the hakyll stuff is effectively IO-ful anyway, I do feel the need to point out that normally one should not be looking for a way to embed IO actions in something that doesn't want them, but rather to separate the IO code from the rest of the code. In this case, that could be easily done by reading the environment variable in main right before the start of the hakyll block.

However, since the hakyll block is obviously wrapping IO underneath anyway, the embedding used in this PR is also quite fine.