Hi,
I have had a number of trivial compilation failures in many of my projects that contain instances for MonadBaseControl (from monad-control) since upgrading to GHC 8.
Now, I say 'trivial' since the actual fix is incredibly minor - a change of compose (.) to apply ($). What was less trivial was the (additional) hair loss arriving at the fix. I've put together a minimal example that demonstrates both the failing (pre-GHC8) and the fixed (GHC8) instances here:
Since I found the error message somewhat directionless, I'd like some help actually understanding the root cause and why the 'fix' works:
* I assume previously GHC did not fully check type aliases that were impredictive prior to GHC 8?
* What does this imply for a type alias such as for the alias RunInBase used in monad-control that contains RankNTypes:
* How does the use of ($) vs (.) fix this particular issue? (I'd naively assume the usage here would be equivalent.) I recall reading about ($)'s magical type alias somewhere - is this related?
Cheers,
Brendan