mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-29 14:32:51 -06:00
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