Merge pull request #1283 from chreekat/comment-for-unsafe

Comment on unsafePerformIO, close #1245
This commit is contained in:
Michael Snoyman 2016-10-05 03:35:04 +03:00 committed by GitHub
commit 25bba1add1
2 changed files with 4 additions and 0 deletions

View File

@ -710,6 +710,8 @@ setLoginLinkKey aid = do
setSession loginLinkKey $ TS.pack $ show (toPathPiece aid, now)
-- See https://github.com/yesodweb/yesod/issues/1245 for discussion on this
-- use of unsafePerformIO.
defaultNonceGen :: Nonce.Generator
defaultNonceGen = unsafePerformIO (Nonce.new)
{-# NOINLINE defaultNonceGen #-}

View File

@ -574,6 +574,8 @@ allPersonInfo (A.Object o) = map enc $ M.toList o
allPersonInfo _ = []
-- See https://github.com/yesodweb/yesod/issues/1245 for discussion on this
-- use of unsafePerformIO.
defaultNonceGen :: Nonce.Generator
defaultNonceGen = unsafePerformIO (Nonce.new)
{-# NOINLINE defaultNonceGen #-}