I am new to Haskell and Yesod, and I'm trying to use the module Control.Concurrent.Asyncto work with async. (code based on: https://hackage.haskell.org/package/async-2.1.1/docs/Control-Concurrent-Async.html#v:withAsync )
quizWidget = do
--Get first question
withAsync (showQuizItem 1 1 ) $ \qi -> do
withAsync (showScoreboard) $ \sb -> do
quizItem <- wait (qi)
scoreboard <- wait (sb)
toWidget $(hamletFile "hamlet/quiz.hamlet")
But this leads to the following error:
"There is no instance for (MonadWidget IO) resulting from the use of" toWidget ".
So the question is what am I doing wrong?
source
share