Send message in CloudHaskell from IO monad

58 Views Asked by At

I want to send message (Cloud Haskell) inside not Process monad.

anyMethod :: Handler ()
anyMethod = do
    ...      
    liftIO $ return $ do _ <- send pid (QnrMes q a)
                         return ()

Here pid is ProcessId. Everything is compiled, but the messages do not come to the process. Is it possible to implement this?

1

There are 1 best solutions below

0
On

I solved the problem. Maybe it'll be useful for anybody.

anyMethod ::App -> Handler ()
anyMethod app = do
    ...      
    (appMesSender app) pid (QnrAnswers questionnaire questionnaireAnswers)

data App = App{appMesSender :: (ProcessId -> UnitMessage -> IO ())
               ...
              }

In fact, I prepared the function in advance.