aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Shaped.hs
diff options
context:
space:
mode:
authorTom Smeding <t.j.smeding@uu.nl>2025-08-04 18:05:05 +0200
committerTom Smeding <t.j.smeding@uu.nl>2025-08-04 18:05:05 +0200
commitdc66969bc009714486da40254aa3eff3ea57b035 (patch)
tree7a671d0703048f2baa3890bba462d99454fe583b /src/Data/Array/Nested/Shaped.hs
parent2fae6bf7f6704e3dd9a3f73acbdc84331adb1bf0 (diff)
Failed experiment to add replicate/transpose combinationreptrans-failed
Diffstat (limited to 'src/Data/Array/Nested/Shaped.hs')
-rw-r--r--src/Data/Array/Nested/Shaped.hs9
1 files changed, 9 insertions, 0 deletions
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')