MonadFix instance for Q

Joe Hermaszewski joe at
Wed Aug 3 09:01:14 UTC 2016

Q is capable of being an instance of MonadFix, I've opened a ticket
here, I'd appreciate it if someone could take a look:

instance MonadFix Q where
  mfix k = do
    m <- runIO newEmptyMVar
    ans <- runIO (unsafeInterleaveIO (takeMVar m))
    result <- k ans
    runIO (putMVar m result)
    pure result

More information about the Libraries mailing list