From 237128fc3aa8ad6478a5cf759ba31e967b24fd77 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Wed, 18 Dec 2024 22:13:10 +0100 Subject: Add some spuriously missing Eq/Generic instances --- src/Data/Array/Nested/Internal/Shaped.hs | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/Data/Array/Nested/Internal/Shaped.hs') diff --git a/src/Data/Array/Nested/Internal/Shaped.hs b/src/Data/Array/Nested/Internal/Shaped.hs index ece4272..4071aad 100644 --- a/src/Data/Array/Nested/Internal/Shaped.hs +++ b/src/Data/Array/Nested/Internal/Shaped.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds #-} +{-# LANGUAGE DeriveGeneric #-} {-# LANGUAGE DerivingVia #-} {-# LANGUAGE FlexibleContexts #-} {-# LANGUAGE FlexibleInstances #-} @@ -35,6 +36,7 @@ import Data.Type.Equality import Data.Vector.Storable qualified as VS import Foreign.Storable (Storable) import GHC.Float qualified (log1p, expm1, log1pexp, log1mexp) +import GHC.Generics (Generic) import GHC.TypeLits import Data.Array.Mixed.XArray (XArray) @@ -73,6 +75,9 @@ instance Elt a => NFData (Shaped sh a) where -- just unwrap the newtype and defer to the general instance for nested arrays newtype instance Mixed sh (Shaped sh' a) = M_Shaped (Mixed sh (Mixed (MapJust sh') a)) + deriving (Generic) + +deriving instance Eq (Mixed sh (Mixed (MapJust sh') a)) => Eq (Mixed sh (Shaped sh' a)) newtype instance MixedVecs s sh (Shaped sh' a) = MV_Shaped (MixedVecs s sh (Mixed (MapJust sh') a)) -- cgit v1.2.3-70-g09d2