From dc66969bc009714486da40254aa3eff3ea57b035 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Mon, 4 Aug 2025 18:05:05 +0200 Subject: Failed experiment to add replicate/transpose combination --- src/Data/Array/Nested/Shaped.hs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/Data/Array/Nested/Shaped.hs') diff --git a/src/Data/Array/Nested/Shaped.hs b/src/Data/Array/Nested/Shaped.hs index 198a068..2c64bb4 100644 --- a/src/Data/Array/Nested/Shaped.hs +++ b/src/Data/Array/Nested/Shaped.hs @@ -1,4 +1,5 @@ {-# LANGUAGE DataKinds #-} +{-# LANGUAGE GADTs #-} {-# LANGUAGE ImportQualifiedPost #-} {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} @@ -199,6 +200,14 @@ srerank :: forall sh1 sh2 sh a b. (PrimElt a, PrimElt b) srerank sh sh2 f (stoPrimitive -> arr) = sfromPrimitive $ srerankP sh sh2 (stoPrimitive . f . sfromPrimitive) arr +-- data RepTrans sh sh' where +-- RTNil :: RepTrans sh '[] +-- RTUse :: SNat i -> RepTrans sh sh' -> RepTrans sh (Index i sh : sh') +-- RTRep :: SNat n -> RepTrans sh sh' -> RepTrans sh (n : sh') + +-- sreptrans :: RepTrans sh sh' -> Shaped sh a -> Shaped sh' a +-- sreptrans + sreplicate :: forall sh sh' a. Elt a => ShS sh -> Shaped sh' a -> Shaped (sh ++ sh') a sreplicate sh (Shaped arr) | Refl <- lemMapJustApp sh (Proxy @sh') -- cgit v1.2.3-70-g09d2