From d69d96270be6d91565a8461b10b10c72efdd955e Mon Sep 17 00:00:00 2001 From: Mikolaj Konarski Date: Sun, 7 Dec 2025 12:28:36 +0100 Subject: Add mvecsReplicate --- src/Data/Array/Nested/Shaped/Base.hs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/Data/Array/Nested/Shaped/Base.hs') diff --git a/src/Data/Array/Nested/Shaped/Base.hs b/src/Data/Array/Nested/Shaped/Base.hs index 98f1241..ded1175 100644 --- a/src/Data/Array/Nested/Shaped/Base.hs +++ b/src/Data/Array/Nested/Shaped/Base.hs @@ -181,6 +181,10 @@ instance (KnownShS sh, KnownElt a) => KnownElt (Shaped sh a) where | Dict <- lemKnownMapJust (Proxy @sh) = MV_Shaped <$> mvecsUnsafeNew idx arr + mvecsReplicate idx (Shaped arr) + | Dict <- lemKnownMapJust (Proxy @sh) + = MV_Shaped <$> mvecsReplicate idx arr + mvecsNewEmpty _ | Dict <- lemKnownMapJust (Proxy @sh) = MV_Shaped <$> mvecsNewEmpty (Proxy @(Mixed (MapJust sh) a)) -- cgit v1.2.3-70-g09d2