Closed snoyberg closed 5 years ago
Sorry for the delay, I've had an extremely busy Q1.
This is strange. Is that constructor no longer in scope? Minour version releases shouldn't cause breakage like that.
I'm not familiar with the changes in transformers, but it does seem like this was a breaking change.
The change made to transformers was to generalize the except
function:
- except :: Either e a -> Except e a
- except m = ExceptT (Identity m)
+ except :: (Monad m) => Either e a -> ExceptT e m a
+ except m = ExceptT (return m)
which breaks the usage of coerce
in
refineM :: Either RefineException a -> RefineM a
refineM = ExceptT.except .> coerce
Using visible type application fixes this with the new version:
refineM :: Either RefineException a -> RefineM a
refineM = ExceptT.except @Identity .> coerce
I'm not sure what the best way to implement this would be so that it works with both the old and newer versions of the transformers
package.
I just added an explicit type signature to coerce
: coerce :: ExceptT RefineException Identity a -> RefineM a
, and checked that it built with the newest transformers as well as previous versions.