Comment on unsafePerformIO, close #1245

This commit is contained in:
Bryan Richter 2016-10-03 08:58:27 -07:00
parent 57d0dab991
commit add9d4393a
No known key found for this signature in database
GPG Key ID: B202264020068BFB
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 #-}