T12170a.hs:20:35: error: [GHC-83865] • Couldn't match type ‘Ref m0’ with ‘IORef’ Expected: IORef (f0 ()) -> m0 (f0 ()) Actual: Ref m0 (f0 ()) -> m0 (f0 ()) The type variable ‘m0’ is ambiguous • In the second argument of ‘(.)’, namely ‘readRef’ In the second argument of ‘(>>=)’, namely ‘join . readRef’ In the expression: newRef (pure ()) >>= join . readRef