diff --git a/Data/Array/Internal.hs b/Data/Array/Internal.hs
--- a/Data/Array/Internal.hs
+++ b/Data/Array/Internal.hs
@@ -21,6 +21,7 @@
 {-# LANGUAGE MultiParamTypeClasses #-}
 {-# LANGUAGE QuantifiedConstraints #-}
 {-# LANGUAGE RecordWildCards #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE UndecidableInstances #-}
@@ -124,6 +125,7 @@
 -- dimension starts you calculate vector index @offset + i*strides[0]@.
 -- To find where item /i,j/ of the two outermost dimensions is you
 -- calculate vector index @offset + i*strides[0] + j*strides[1]@, etc.
+type role T representational nominal
 data T v a = T
     { strides :: ![Int]   -- length is tensor rank
     , offset  :: !Int     -- offset into vector of values
diff --git a/Data/Array/Internal/Dynamic.hs b/Data/Array/Internal/Dynamic.hs
--- a/Data/Array/Internal/Dynamic.hs
+++ b/Data/Array/Internal/Dynamic.hs
@@ -19,6 +19,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE UndecidableInstances #-}
 module Data.Array.Internal.Dynamic(
@@ -103,6 +104,7 @@
   {-# INLINE vAny #-}
   vAny = V.any
 
+type role Array nominal
 newtype Array a = A { unA :: G.Array V.Vector a }
   deriving (Pretty, Generic, Data)
 
diff --git a/Data/Array/Internal/DynamicG.hs b/Data/Array/Internal/DynamicG.hs
--- a/Data/Array/Internal/DynamicG.hs
+++ b/Data/Array/Internal/DynamicG.hs
@@ -17,6 +17,7 @@
 {-# LANGUAGE DeriveGeneric #-}
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE UndecidableInstances #-}
 -- | Arrays of dynamic size.  The arrays are polymorphic in the underlying
@@ -54,6 +55,7 @@
 import Data.Array.Internal
 
 -- | Arrays stored in a /v/ with values of type /a/.
+type role Array representational nominal
 data Array v a = A !ShapeL !(T v a)
   deriving (Generic, Data)
 
diff --git a/Data/Array/Internal/DynamicS.hs b/Data/Array/Internal/DynamicS.hs
--- a/Data/Array/Internal/DynamicS.hs
+++ b/Data/Array/Internal/DynamicS.hs
@@ -20,6 +20,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE UndecidableInstances #-}
@@ -110,10 +111,11 @@
   {-# INLINE vAny #-}
   vAny = V.any
 
+type role Array nominal
 newtype Array a = A { unA :: G.Array V.Vector a }
   deriving (Pretty, Generic, Data)
 
-instance NFData a => NFData (Array a)
+instance NFData (Array a)
 
 instance (Show a, Unbox a) => Show (Array a) where
   showsPrec p = showsPrec p . unA
diff --git a/Data/Array/Internal/DynamicU.hs b/Data/Array/Internal/DynamicU.hs
--- a/Data/Array/Internal/DynamicU.hs
+++ b/Data/Array/Internal/DynamicU.hs
@@ -20,6 +20,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE TypeFamilies #-}
 {-# LANGUAGE UndecidableInstances #-}
 module Data.Array.Internal.DynamicU(
@@ -107,10 +108,11 @@
   {-# INLINE vAny #-}
   vAny = V.any
 
+type role Array nominal
 newtype Array a = A { unA :: G.Array V.Vector a }
   deriving (Pretty, Generic, Data)
 
-instance NFData a => NFData (Array a)
+instance NFData (Array a)
 
 instance (Show a, Unbox a) => Show (Array a) where
   showsPrec p = showsPrec p . unA
diff --git a/Data/Array/Internal/Ranked.hs b/Data/Array/Internal/Ranked.hs
--- a/Data/Array/Internal/Ranked.hs
+++ b/Data/Array/Internal/Ranked.hs
@@ -22,6 +22,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -61,6 +62,7 @@
 import Data.Array.Internal(ShapeL, Vector(..))
 import Text.PrettyPrint.HughesPJClass hiding ((<>))
 
+type role Array nominal nominal
 newtype Array n a = A { unA :: G.Array n V.Vector a }
   deriving (Pretty, Generic, Data)
 
diff --git a/Data/Array/Internal/RankedG.hs b/Data/Array/Internal/RankedG.hs
--- a/Data/Array/Internal/RankedG.hs
+++ b/Data/Array/Internal/RankedG.hs
@@ -23,6 +23,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE KindSignatures #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -63,10 +64,12 @@
 import Data.Array.Internal
 
 -- | Arrays stored in a /v/ with values of type /a/.
+type role Array nominal representational nominal
 data Array (n :: Nat) v a = A !ShapeL !(T v a)
   deriving (Generic, Data)
 
 instance (Vector v, Show a, VecElem v a) => Show (Array n v a) where
+  {-# INLINABLE showsPrec #-}
   showsPrec p a@(A s _) = showParen (p > 10) $
     showString "fromList " . showsPrec 11 s . showString " " . showsPrec 11 (toList a)
 
@@ -169,7 +172,7 @@
            ShapeL -> Array n v a -> Array n' v a
 reshape sh (A sh' t@(T ost oo v))
   | n /= n' = error $ "reshape: size mismatch " ++ show (sh, sh')
-  | length sh /= valueOf @n' = error $ "reshape: rank mismatch " ++ show (length sh, valueOf @n :: Int)
+  | length sh /= valueOf @n' = error $ "reshape: rank mismatch " ++ show (length sh, valueOf @n' :: Int)
   | vLength v == 1 = A sh $ T (map (const 0) sh) 0 v  -- Fast special case for singleton vector
   | Just nst <- simpleReshape ost sh' sh = A sh $ T nst oo v
   | otherwise = A sh $ T st 0 $ toVectorT sh' t
@@ -319,7 +322,7 @@
 {-# INLINE window #-}
 window :: forall n n' v a . (Vector v, KnownNat n, KnownNat n') =>
           [Int] -> Array n v a -> Array n' v a
-window aws _ | valueOf @n' /= length aws + valueOf @n = error $ "window: rank mismatch: " ++ show (valueOf @n :: Int, length aws, valueOf @n' :: Int)
+window aws _ | valueOf @n' /= length aws + valueOf @n = error $ "window: rank mismatch: " ++ show (valueOf @n' :: Int, length aws, valueOf @n :: Int)
 window aws (A ash (T ss o v)) = A (win aws ash) (T (ss' ++ ss) o v)
   where ss' = zipWith const ss aws
         win (w:ws) (s:sh) | w <= s = s - w + 1 : win ws sh
diff --git a/Data/Array/Internal/RankedS.hs b/Data/Array/Internal/RankedS.hs
--- a/Data/Array/Internal/RankedS.hs
+++ b/Data/Array/Internal/RankedS.hs
@@ -22,6 +22,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -64,10 +65,11 @@
 
 type Unbox = V.Storable
 
+type role Array nominal nominal
 newtype Array n a = A { unA :: G.Array n V.Vector a }
   deriving (Pretty, Generic, Data)
 
-instance NFData a => NFData (Array n a)
+instance NFData (Array n a)
 
 instance (Show a, Unbox a) => Show (Array n a) where
   showsPrec p = showsPrec p . unA
@@ -116,13 +118,13 @@
 -- Fails if the given shape does not have the same number of elements as the list.
 -- O(n) time.
 {-# INLINABLE fromList #-}
-fromList :: (Unbox a, KnownNat n) => ShapeL -> [a] -> Array n a
+fromList :: forall n a . (Unbox a, KnownNat n) => ShapeL -> [a] -> Array n a
 fromList ss = A . G.fromList ss
 
 -- | Convert to a vector with the elements in the linearization order.
 -- O(n) or O(1) time (the latter if the vector is already in the linearization order).
 {-# INLINABLE toVector #-}
-toVector :: (Unbox a) => Array n a -> V.Vector a
+toVector :: forall n a . (Unbox a) => Array n a -> V.Vector a
 toVector = G.toVector . unA
 
 -- | Convert from a vector with the elements given in the linearization order.
@@ -167,6 +169,7 @@
 
 -- | Make an array with all elements having the same value.
 -- O(1) time
+{-# INLINABLE constant #-}
 constant :: (Unbox a, KnownNat n) => ShapeL -> a -> Array n a
 constant sh = A . G.constant sh
 
diff --git a/Data/Array/Internal/RankedU.hs b/Data/Array/Internal/RankedU.hs
--- a/Data/Array/Internal/RankedU.hs
+++ b/Data/Array/Internal/RankedU.hs
@@ -22,6 +22,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -63,10 +64,11 @@
 
 type Unbox = V.Unbox
 
+type role Array nominal nominal
 newtype Array n a = A { unA :: G.Array n V.Vector a }
   deriving (Pretty, Generic, Data)
 
-instance NFData a => NFData (Array n a)
+instance NFData (Array n a)
 
 instance (Show a, Unbox a) => Show (Array n a) where
   showsPrec p = showsPrec p . unA
@@ -113,12 +115,12 @@
 -- | Convert from a list with the elements given in the linearization order.
 -- Fails if the given shape does not have the same number of elements as the list.
 -- O(n) time.
-fromList :: (Unbox a, KnownNat n) => ShapeL -> [a] -> Array n a
+fromList :: forall n a . (Unbox a, KnownNat n) => ShapeL -> [a] -> Array n a
 fromList ss = A . G.fromList ss
 
 -- | Convert to a vector with the elements in the linearization order.
 -- O(n) or O(1) time (the latter if the vector is already in the linearization order).
-toVector :: (Unbox a) => Array n a -> V.Vector a
+toVector :: forall n a . (Unbox a) => Array n a -> V.Vector a
 toVector = G.toVector . unA
 
 -- | Convert from a vector with the elements given in the linearization order.
diff --git a/Data/Array/Internal/Shape.hs b/Data/Array/Internal/Shape.hs
--- a/Data/Array/Internal/Shape.hs
+++ b/Data/Array/Internal/Shape.hs
@@ -115,7 +115,7 @@
 -----------------
 
 class Permutation (is :: [Nat])
-instance (AllElem is (Count 0 is)) => Permutation is
+instance (AllElem is (Count 0 is), AllElem (Count 0 is) is) => Permutation is
 
 type family Count (i :: Nat) (xs :: [Nat]) :: [Nat] where
   Count i '[] = '[]
diff --git a/Data/Array/Internal/Shaped.hs b/Data/Array/Internal/Shaped.hs
--- a/Data/Array/Internal/Shaped.hs
+++ b/Data/Array/Internal/Shaped.hs
@@ -21,6 +21,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -61,6 +62,7 @@
 import Data.Array.Internal(ShapeL, Vector)
 import Data.Array.Internal.Shape
 
+type role Array nominal nominal
 newtype Array sh a = A { unA :: G.Array sh V.Vector a }
   deriving (Pretty, Generic, Data)
 
diff --git a/Data/Array/Internal/ShapedG.hs b/Data/Array/Internal/ShapedG.hs
--- a/Data/Array/Internal/ShapedG.hs
+++ b/Data/Array/Internal/ShapedG.hs
@@ -22,6 +22,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE KindSignatures #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -64,10 +65,12 @@
 import Data.Array.Internal.Shape
 
 -- | Arrays stored in a /v/ with values of type /a/.
+type role Array nominal representational nominal
 newtype Array (sh :: [Nat]) v a = A (T v a)
   deriving (Generic, Data)
 
 instance (Vector v, Show a, VecElem v a, Shape sh, Show (v a)) => Show (Array sh v a) where
+  {-# INLINABLE showsPrec #-}
   showsPrec p a@(A _) = showParen (p > 10) $
     showString "fromList @" . showsPrec 11 (shapeL a) . showString" " . showsPrec 11 (toList a)
 
diff --git a/Data/Array/Internal/ShapedS.hs b/Data/Array/Internal/ShapedS.hs
--- a/Data/Array/Internal/ShapedS.hs
+++ b/Data/Array/Internal/ShapedS.hs
@@ -22,6 +22,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -65,10 +66,11 @@
 
 type Unbox = V.Storable
 
+type role Array nominal nominal
 newtype Array sh a = A { unA :: G.Array sh V.Vector a }
   deriving (Pretty, Generic, Data)
 
-instance NFData a => NFData (Array sh a)
+instance NFData (Array sh a)
 
 instance (Unbox a, Show a, Shape sh) => Show (Array sh a) where
   showsPrec p = showsPrec p . unA
@@ -169,6 +171,7 @@
 
 -- | Make an array with all elements having the same value.
 -- O(1) time.
+{-# INLINABLE constant #-}
 constant :: forall sh a . (Unbox a, Shape sh) =>
             a -> Array sh a
 constant = A . G.constant
diff --git a/Data/Array/Internal/ShapedU.hs b/Data/Array/Internal/ShapedU.hs
--- a/Data/Array/Internal/ShapedU.hs
+++ b/Data/Array/Internal/ShapedU.hs
@@ -22,6 +22,7 @@
 {-# LANGUAGE FlexibleInstances #-}
 {-# LANGUAGE GeneralizedNewtypeDeriving #-}
 {-# LANGUAGE MultiParamTypeClasses #-}
+{-# LANGUAGE RoleAnnotations #-}
 {-# LANGUAGE ScopedTypeVariables #-}
 {-# LANGUAGE TypeApplications #-}
 {-# LANGUAGE TypeFamilies #-}
@@ -63,10 +64,11 @@
 
 type Unbox = V.Unbox
 
+type role Array nominal nominal
 newtype Array sh a = A { unA :: G.Array sh V.Vector a }
   deriving (Pretty, Generic, Data)
 
-instance NFData a => NFData (Array sh a)
+instance NFData (Array sh a)
 
 instance (Unbox a, Show a, Shape sh) => Show (Array sh a) where
   showsPrec p = showsPrec p . unA
diff --git a/orthotope.cabal b/orthotope.cabal
--- a/orthotope.cabal
+++ b/orthotope.cabal
@@ -1,5 +1,5 @@
 name:                orthotope
-version:             0.1.6.0
+version:             0.1.7.0
 synopsis:            Multidimensional arrays inspired by APL
 license:             Apache
 license-file:        LICENSE
@@ -18,7 +18,7 @@
       LICENSE
       README.md
 
-tested-with:         GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.5 || ==9.6.1 || ==9.6.2
+tested-with:         GHC ==8.10.7 || ==9.0.2 || ==9.2.8 || ==9.4.7 || ==9.6.6 || ==9.8.4 || ==9.10.1 || ==9.12.1
 
 source-repository head
     type:     git
@@ -26,7 +26,9 @@
 
 library
   hs-source-dirs:      .
-  ghc-options:         -Wall
+  ghc-options:         -Wall -Wno-unrecognised-warning-flags -Wno-x-partial
+--  if impl(ghc >= 9.8)
+--      ghc-options: -Wmissing-role-annotations
   exposed-modules:     Data.Array.Convert
                      , Data.Array.Dynamic
                      , Data.Array.DynamicG
@@ -58,9 +60,9 @@
                      , Data.Array.Internal.ShapedS
                      , Data.Array.Internal.ShapedU
 
-  build-depends:       base             >= 4.12 && < 4.20,
-                       QuickCheck       >= 2.14.3 && < 2.15,
-                       deepseq          >= 1.4.4 && < 1.5,
+  build-depends:       base             >= 4.12 && < 4.22,
+                       QuickCheck       >= 2.14.3 && < 2.16,
+                       deepseq          >= 1.4.4 && < 1.7,
                        pretty           >= 1.1.3 && < 1.2,
                        dlist            >= 1.0 && < 1.1,
                        vector           >= 0.12.0 && < 0.14
