
17 Dec
2007
17 Dec
'07
3:40 p.m.
Am Montag, 17. Dezember 2007 21:06 schrieb ChrisK:
Andre Nathan wrote:
Hello (Newbie question ahead :
I tried this for insertProc, but it obviously doesn't work... what would be the correct way to do this?
insertProc :: Pid -> StateT PsMap IO PsInfo insertProc pid = do proc <- procInfo pid -- XXX this is obviously wrong... psMap <- get put (Map.insert pid proc psMap) return (proc)
I see that using "lift" makes it compile (Control.Monad.Trans.lift):
insertProc pid = do proc <- lift (procInfo pid)
By the way, be careful with identifiers named “proc”. There is a syntax extension (arrow notation) which introduces a new keyword “proc”. Best wishes, Wolfgang