From 1850c00e9d59e24bfa11c2a3e0fb784f53b401be Mon Sep 17 00:00:00 2001 From: Arjun Kathuria Date: Mon, 13 Mar 2023 00:25:04 +0530 Subject: [PATCH] fix: project build error with new haskus-utils-variant version * New haskus-utils-variant version 3.3 now includes the function "throwSomeE", which was now causing a compile error, since we have a function of the same name in our code. * The function imported from the package and our own version clashed. * Solution was to conditionally include our shim when haskus-utils-variant version < 3.3 --- lib/GHCup/Prelude.hs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/GHCup/Prelude.hs b/lib/GHCup/Prelude.hs index af494ca..1de047b 100644 --- a/lib/GHCup/Prelude.hs +++ b/lib/GHCup/Prelude.hs @@ -77,8 +77,14 @@ runBothE' a1 a2 = do (_ , VLeft e ) -> throwSomeE e (VRight _, VRight _) -> pure () +-- "throwSomeE" function has been upstreamed in haskus-utils-variant-3.3 +-- So, only conditionally include this shim if +-- haskus-utils-variant version is < 3.3 +#if MIN_VERSION_haskus_utils_variant(3,3,0) +#else -- | Throw some exception throwSomeE :: forall es' es a m. (Monad m, LiftVariant es' es) => V es' -> Excepts es m a {-# INLINABLE throwSomeE #-} throwSomeE = Excepts . pure . VLeft . liftVariant +#endif