diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-10-09 09:25:07 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-10-09 09:25:07 +0200 |
commit | 62c4d56bfb75e933b5307930859f6c9366217ab1 (patch) | |
tree | 60579d096304037c6990b424d618f077a2aeccc3 /src/Data/Array/Nested/Internal/Ranked.hs | |
parent | 48bb58de893bdd28a8bae534bf618fb5790833ca (diff) |
Add rToMixed and stoMixed
These are somewhat redundant because one can just open up the Ranked and
Shaped newtype constructors, but let's complete the triangle of
conversion functions.
Diffstat (limited to 'src/Data/Array/Nested/Internal/Ranked.hs')
-rw-r--r-- | src/Data/Array/Nested/Internal/Ranked.hs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Internal/Ranked.hs b/src/Data/Array/Nested/Internal/Ranked.hs index 735d1a3..ffa1cea 100644 --- a/src/Data/Array/Nested/Internal/Ranked.hs +++ b/src/Data/Array/Nested/Internal/Ranked.hs @@ -524,3 +524,6 @@ mtoRanked arr convSh (smn :$% (sh :: IShX sh'T)) | Refl <- lemReplicateSucc @(Nothing @Nat) @(Rank sh'T) = SUnknown (fromSMayNat' smn) :$% convSh sh + +rtoMixed :: forall n a. Elt a => Ranked n a -> Mixed (Replicate n Nothing) a +rtoMixed (Ranked arr) = arr |