<div dir="ltr">> remLookupFwd :: (ReVars m t) => SimplRe t -> ReM m t (ReInfo t)<br>
> remLookupFwd re<br>
> = do fwd <- gets resFwdMap<br>
> -- let { Just reinfo = M.lookup fwd re } -- PROBLEM<br>
> reinfo <- liftMaybe $ M.lookup re fwd -- PROBLEM<br>
> return reinfo<br>
><br>
> liftMaybe :: Monad m => Maybe a -> m a<br>
> liftMaybe Nothing = fail "Nothing"<br>
> liftMaybe (Just x) = return x<br>
<br>I made two changes:<br>
<br>
1. You had the arguments to M.lookup backwards.<br>
2. lookup does not return any generalized Monad, just Maybe (I think that should be changed). I added the simple liftMaybe function to convert the Maybe result into something that will work with your state monad.<br><br>
Michael<br></div>