From 01d6f63d9e8f1473297e718b4023a07606a8ae3e Mon Sep 17 00:00:00 2001 From: Lennart Augustsson Date: Wed, 5 Nov 2025 10:04:34 +0100 Subject: [PATCH 1/2] Make it compile with MicroHs --- Control/Concurrent/Async/Internal.hs | 4 ++++ Control/Concurrent/Async/Warden.hs | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Control/Concurrent/Async/Internal.hs b/Control/Concurrent/Async/Internal.hs index fe65c90..9ad660f 100644 --- a/Control/Concurrent/Async/Internal.hs +++ b/Control/Concurrent/Async/Internal.hs @@ -57,6 +57,10 @@ import GHC.Exts import GHC.IO hiding (finally, onException) import GHC.Conc (ThreadId(..)) +#if defined(__MHS__) +import Data.Traversable +#endif + #ifdef DEBUG_AUTO_LABEL import qualified GHC.Stack #endif diff --git a/Control/Concurrent/Async/Warden.hs b/Control/Concurrent/Async/Warden.hs index ec259be..e818995 100644 --- a/Control/Concurrent/Async/Warden.hs +++ b/Control/Concurrent/Async/Warden.hs @@ -5,7 +5,7 @@ This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. -} - +{-# LANGUAGE CPP #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -27,11 +27,17 @@ import Control.Concurrent.Async (Async) import qualified Control.Concurrent.Async as Async import Control.Concurrent.MVar import Control.Exception -import Control.Monad import Data.HashSet (HashSet) import qualified Data.HashSet as HashSet import System.IO (fixIO) +#if defined(__MHS__) +import Prelude hiding(mapM_) +import Data.Foldable(mapM_) +import Control.Monad hiding(mapM_) +#else +import Control.Monad +#endif -- | A 'Warden' is an owner of 'Async's which cancels them on 'shutdown'. -- From 4aad30aba3c59a8e3ed822142acb7ef7d41ade39 Mon Sep 17 00:00:00 2001 From: Lennart Augustsson Date: Fri, 7 Nov 2025 12:07:15 +0100 Subject: [PATCH 2/2] Slightly nicer fix --- Control/Concurrent/Async/Warden.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Control/Concurrent/Async/Warden.hs b/Control/Concurrent/Async/Warden.hs index e818995..a3b19a5 100644 --- a/Control/Concurrent/Async/Warden.hs +++ b/Control/Concurrent/Async/Warden.hs @@ -33,8 +33,8 @@ import System.IO (fixIO) #if defined(__MHS__) import Prelude hiding(mapM_) -import Data.Foldable(mapM_) import Control.Monad hiding(mapM_) +import Data.Foldable(mapM_) #else import Control.Monad #endif