diff --git a/src/Semantic/Distribute.hs b/src/Semantic/Distribute.hs index f9905afe9..a6e987443 100644 --- a/src/Semantic/Distribute.hs +++ b/src/Semantic/Distribute.hs @@ -60,7 +60,7 @@ instance Carrier (Distribute :+: Lift IO) (DistributeC (LiftC IO)) where eff (R other) = DistributeC (eff (handleCoercible other)) instance MonadUnliftIO m => MonadUnliftIO (DistributeC m) where - askUnliftIO = DistributeC $ withUnliftIO $ \u -> return (UnliftIO (unliftIO u . runDistributeC)) + askUnliftIO = DistributeC $ withUnliftIO $ \u -> pure (UnliftIO (unliftIO u . runDistributeC)) {-# INLINE askUnliftIO #-} withRunInIO inner = DistributeC $ withRunInIO $ \run -> inner (run . runDistributeC) {-# INLINE withRunInIO #-} diff --git a/src/Semantic/Task/Files.hs b/src/Semantic/Task/Files.hs index 3db94d86b..69d2f1a9e 100644 --- a/src/Semantic/Task/Files.hs +++ b/src/Semantic/Task/Files.hs @@ -116,6 +116,6 @@ findFiles dir exts paths = send (FindFiles dir exts paths pure) write :: (Member Files sig, Carrier sig m) => Destination -> B.Builder -> m () write dest builder = send (Write dest builder (pure ())) --- | Catch exceptions thrown in 'IO' and rethrow them in an 'Error' effect. +-- | Catch synchronous exceptions thrown in 'IO' and rethrow them in an 'Error' effect. rethrowing :: (Member Catch sig, Member (Error SomeException) sig, Carrier sig m) => m a -> m a -rethrowing act = act `catchSync` (throwError @SomeException) +rethrowing act = act `catchSync` throwError @SomeException