forked from GitHub/gf-core
GF.Compile.ReadFiles: reduced code duplication
This commit is contained in:
@@ -139,6 +139,8 @@ instance Monad IOE where
|
||||
appIOE $ err raise f x -- f :: a -> IOE a
|
||||
fail = raise
|
||||
|
||||
maybeIO io = either (const Nothing) Just `fmap` liftIO (try io)
|
||||
|
||||
useIOE :: a -> IOE a -> IO a
|
||||
useIOE a ioe = appIOE ioe >>= err (\s -> putStrLn s >> return a) return
|
||||
|
||||
|
||||
Reference in New Issue
Block a user