aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikolaj Konarski <mikolaj.konarski@gmail.com>2024-07-21 18:47:51 +0200
committerMikolaj Konarski <mikolaj.konarski@gmail.com>2024-07-21 18:47:51 +0200
commit774730c3b2742c59bea532e32f43fa12397a3a15 (patch)
tree73ec436184637423a397534b21a2b8b45e6947ce /src
parent9e675915525cf1b19269a0fec474a2537d2033d7 (diff)
Add an awkward extra Typeable constraint that helps comparing shapes
Diffstat (limited to 'src')
-rw-r--r--src/Data/Array/Nested/Internal/Shape.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Data/Array/Nested/Internal/Shape.hs b/src/Data/Array/Nested/Internal/Shape.hs
index 7077053..0d75b04 100644
--- a/src/Data/Array/Nested/Internal/Shape.hs
+++ b/src/Data/Array/Nested/Internal/Shape.hs
@@ -38,6 +38,7 @@ import GHC.IsList (IsList)
import GHC.IsList qualified as IsList
import GHC.TypeLits
import GHC.TypeNats qualified as TN
+import Type.Reflection (Typeable)
import Data.Array.Mixed.Lemmas
import Data.Array.Mixed.Permutation
@@ -541,7 +542,7 @@ shsProduct (n :$$ sh) = n `snatMul` shsProduct sh
-- | Evidence for the static part of a shape. This pops up only when you are
-- polymorphic in the element type of an array.
type KnownShS :: [Nat] -> Constraint
-class KnownShS sh where knownShS :: ShS sh
+class Typeable sh => KnownShS sh where knownShS :: ShS sh
instance KnownShS '[] where knownShS = ZSS
instance (KnownNat n, KnownShS sh) => KnownShS (n : sh) where knownShS = natSing :$$ knownShS