Closed phadej closed 4 years ago
I haven't followed the recent GHC/base versions, but, judging by the error message, I'm assuming fail
is no longer part of the definition of Monad
?
If I don't miss some other issues: the easiest, and non (strictly) breaking change is to change
-- | Read a JavaScript program from file an parse it into a list of
-- statements
parseJavaScriptFromFile :: MonadIO m => String -- ^ file name
-> m [Statement SourcePos]
parseJavaScriptFromFile filename = do
chars <- liftIO $ readFile filename
case parse parseScript filename chars of
Left err -> fail (show err)
Right (Script _ stmts) -> return stmts
into
-- | Read a JavaScript program from file an parse it into a list of
-- statements
parseJavaScriptFromFile :: MonadIO m => String -- ^ file name
-> m [Statement SourcePos]
parseJavaScriptFromFile filename = do
chars <- liftIO $ readFile filename
case parse parseScript filename chars of
Left err -> liftIO (throwIO (userError (show err))) -- or some custom exception
Right (Script _ stmts) -> return stmts
fail for IO
throws userError
anyway, so the behavior will be quite the same.
The change looks good to me. Could you submit a PR with it? If not I'll patch and release myself later today.
Sorry, but I have no time to spare more than to just report. For me the proper bounds on Hackage is enough, and that's done.
Hi @achudnov,
Could you please publish new version on Hackage?
I’ll try to do it this weekend. The Travis config is broken, so I’ve been unable to test on earlier compiler versions.
On Feb 6, 2020, at 3:41 PM, Andrey Prokopenko notifications@github.com wrote:
Hi @achudnov,
Could you please publish new version on Hackage?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@dmjio for assistance with the Travis config.
Fixed in 0.19.0.1 on Hackage
I made revisions (about revisions) to correct version bounds https://hackage.haskell.org/package/language-ecmascript-0.19/revisions/