Browse Source

Added signature to liftIOF

addedsingle
Alberto G. Corona 5 years ago
parent
commit
150faa7d51
  1. 4
      src/Transient/Move.hs
  2. 8
      tests/cell.hs

4
src/Transient/Move.hs

@ -47,8 +47,7 @@ addNodes, shuffleNodes,
) where
import Transient.Base
import Transient.Internals(IDynamic(..),killChildren,getCont,runCont,EventF(..),LogElem(..),Log(..)
,onNothing,RemoteStatus(..),getCont,StateIO,readsPrec')
import Transient.Internals hiding ((!>))
import Transient.Logged
import Transient.Indeterminism(choose)
import Transient.Backtrack
@ -578,6 +577,7 @@ mclose (Connection _ (Just (Web2Node sconn)) _ _ blocked _ _)=
#endif
liftIOF :: IO b -> TransIO b
liftIOF mx=do
ex <- liftIO $ (mx >>= return . Right) `catch` (\(e :: SomeException) -> return $ Left e)
case ex of

8
tests/cell.hs

@ -21,15 +21,15 @@ app= onBrowser $ local $ render $ do
where
size= atr "size"
space = scell "space" $ runCloud $ atRemote $ local $ do
space = scell "space" $ do -- runCloud $ atRemote $ local $ do
liftIO $ print "running cella at server"
norender $ gcell "speed" * gcell "time"
time = scell "time" $ runCloud $ atRemote $ local $ do
time = scell "time" $ do -- runCloud $ atRemote $ local $ do
liftIO $ print "running cellb at server"
norender $ gcell "space" / gcell "speed"
norender $ gcell "space" / gcell "speed"
speed = scell "speed" $ runCloud $ atRemote $ local $ do
speed = scell "speed" $ do -- runCloud $ atRemote $ local $ do
liftIO $ print "running cellc at server"
norender $ gcell "space" / gcell "time"

Loading…
Cancel
Save