New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix building with Template Haskell 2.18 / GHC 9.2. #1716
base: master
Are you sure you want to change the base?
Conversation
@@ -206,12 +206,12 @@ instance MonadTrans (ResultT a) where | |||
instance (MonadIO m, Error a) => MonadIO (ResultT a m) where | |||
liftIO = ResultT . liftIO | |||
. liftM (either (failError . show) return) | |||
. (try :: IO a -> IO (Either IOError a)) | |||
. (try :: IO α -> IO (Either IOError α)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being late.
What has changed here? Latin letter a
to Greek letter α
(alpha)? Is this intentional? And if so, why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is presumably to decouple the inner (IO a
) from the outer (Error a
) type, letting type inference do its magic. @mbakke Greek letters are great (obviously, I'm Greek :-) but it's rather unusual to encounter them in source code. I would stick with ASCII characters if possible, e.g. we could try using a'
here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mbakke thanks for the PR and apologies for the extremely long delay.
Other than α
, I would just like to see a brief commit message describing the two changes.
@@ -206,12 +206,12 @@ instance MonadTrans (ResultT a) where | |||
instance (MonadIO m, Error a) => MonadIO (ResultT a m) where | |||
liftIO = ResultT . liftIO | |||
. liftM (either (failError . show) return) | |||
. (try :: IO a -> IO (Either IOError a)) | |||
. (try :: IO α -> IO (Either IOError α)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is presumably to decouple the inner (IO a
) from the outer (Error a
) type, letting type inference do its magic. @mbakke Greek letters are great (obviously, I'm Greek :-) but it's rather unusual to encounter them in source code. I would stick with ASCII characters if possible, e.g. we could try using a'
here.
|
||
instance (MonadBase IO m, Error a) => MonadBase IO (ResultT a m) where | ||
liftBase = ResultT . liftBase | ||
. liftM (either (failError . show) return) | ||
. (try :: IO a -> IO (Either IOError a)) | ||
. (try :: IO α -> IO (Either IOError α)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ditto
Hello,
Here is another hack similar to #1694 that fixes building with GHC 9.2 simply by commenting type signatures. Also introduce a
myConP
for backwards compatibility with Template Haskell < 2.18.CC @apoikos .