From ef72e54cf6bcee7124058364fea15b4d1bd62cd7 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Thu, 2 Oct 2025 14:07:53 +0200 Subject: Compatibility with GHC 9.6 --- src/Data/Array/XArray.hs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Data/Array/XArray.hs') diff --git a/src/Data/Array/XArray.hs b/src/Data/Array/XArray.hs index bf47622..92d9e13 100644 --- a/src/Data/Array/XArray.hs +++ b/src/Data/Array/XArray.hs @@ -1,3 +1,4 @@ +{-# LANGUAGE CPP #-} {-# LANGUAGE DataKinds #-} {-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE FlexibleInstances #-} @@ -30,6 +31,9 @@ import Data.Vector.Storable qualified as VS import Foreign.Storable (Storable) import GHC.Generics (Generic) import GHC.TypeLits +#if !MIN_VERSION_GLASGOW_HASKELL(9,8,0,0) +import Unsafe.Coerce (unsafeCoerce) +#endif import Data.Array.Nested.Lemmas import Data.Array.Nested.Mixed.Shape @@ -217,7 +221,11 @@ transpose ssh perm (XArray arr) , Refl <- lemRankApp (ssxPermute perm (ssxTakeLen perm ssh)) (ssxDropLen perm ssh) , Refl <- lemRankPermute (Proxy @(TakeLen is sh)) perm , Refl <- lemRankDropLen ssh perm +#if MIN_VERSION_GLASGOW_HASKELL(9,8,0,0) = XArray (S.transpose (permToList' perm) arr) +#else + = XArray (unsafeCoerce (S.transpose (permToList' perm) arr)) +#endif -- | The list argument gives indices into the original dimension list. -- -- cgit v1.2.3-70-g09d2