What does fixIO do?

前端 未结 2 788
后悔当初
后悔当初 2021-02-13 02:09

The System.IO docs contains a mysterious, undocumented function fixIO. Its source only adds to the mystery:

fixIO :: (a -> IO a) -> IO a
fixIO         


        
2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-02-13 02:43

    fixIO is the witness to the MonadFix IO instance. See the HaskellWiki page on MonadFix and the paper A Recursive do for Haskell.

提交回复
热议问题