diff options
author | Tom Smeding <tom@tomsmeding.com> | 2025-10-02 14:07:53 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2025-10-02 14:07:53 +0200 |
commit | ef72e54cf6bcee7124058364fea15b4d1bd62cd7 (patch) | |
tree | 90981bbae6b4be2cc075c65c792a560c44b3b05b /src/Data/Array/XArray.hs | |
parent | 22a3d9c5cbafb7a633f2f802af884d042718e78d (diff) |
Compatibility with GHC 9.6
Diffstat (limited to 'src/Data/Array/XArray.hs')
-rw-r--r-- | src/Data/Array/XArray.hs | 8 |
1 files changed, 8 insertions, 0 deletions
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. -- |