@@ -1,4 +1,3 @@
1−{-# LANGUAGE CPP #-}
21-- | The 'Writer' as an effect.
32module Effectful.Writer
43 ( Writer
@@ -41,17 +40,12 @@ listen
4140 => Eff es a
4241 -> Eff es (a, w)
4342listen (Eff m) = unsafeEff $ \es -> mask $ \restore -> do
44−#if __GLASGOW_HASKELL__ >= 900
45− error $ "'listen' temporarily doesn't compile with released GHC 9.* versions"
46− ++ " due to a GHC bug. If you want to use 'listen', please use GHC 8.*"
47−#else
4843 w0 <- unsafeStateEnv (\(IdE (Writer w)) -> (w, IdE (Writer mempty))) es
4944 -- If an exception is thrown, restore e0 and keep parts of e1.
5045 a <- restore (m es) `onException`
5146 unsafeModifyEnv (\(IdE (Writer w)) -> IdE (Writer (w0 `mappend` w))) es
5247 w1 <- unsafeStateEnv (\(IdE (Writer w)) -> (w, IdE (Writer (w0 `mappend` w)))) es
5348 pure (a, w1)
54−#endif
5549
5650listens
5751 :: (Writer w :> es, Monoid w)