{-# LANGUAGE OverloadedRecordDot, NoFieldSelectors #-}
module Cont where
newtype ContT r m a = ContT { runContT :: (a -> m r) -> m r }
instance Functor (ContT r m) where
fmap f m = ContT $ \ c -> m.runContT (c . f)
main :: IO ()
main = pure ()
Compiles with GHC 9.10.1 using ghc -fforce-recomp -c Cont.hs, but fails with latest MicroHs invoked as mhs Cont:
mhs: "./Cont.hs": line 7, col 33: free type variable in output fundep
Since this compiles in GHC and I only use supported extensions, I was expecting this to compile in MicroHs.
If the instance is instead written as
instance Functor (ContT r m) where
fmap f (ContT m) = ContT $ \ c -> m (c . f)
File name
Cont.hs
:Compiles with GHC 9.10.1 using
ghc -fforce-recomp -c Cont.hs
, but fails with latest MicroHs invoked asmhs Cont
:Since this compiles in GHC and I only use supported extensions, I was expecting this to compile in MicroHs.
If the instance is instead written as
it compiles successfully.