aboutsummaryrefslogtreecommitdiff
path: root/src/Data/Array/Nested/Mixed
diff options
context:
space:
mode:
authorMikolaj Konarski <mikolaj.konarski@funktory.com>2025-12-14 23:12:30 +0100
committerMikolaj Konarski <mikolaj.konarski@funktory.com>2025-12-16 09:55:06 +0100
commit8579a03c5ae8f4812b72d477251a614d820dd1fc (patch)
tree43cdbf892ad803e693151e8c7fa37412a755ebb9 /src/Data/Array/Nested/Mixed
parent7e8cb11edf6cb6f46cf92e7dac10e75281992a0a (diff)
Implement shxFromShS and shsFromShX as a newtype coerce
Diffstat (limited to 'src/Data/Array/Nested/Mixed')
-rw-r--r--src/Data/Array/Nested/Mixed/Shape.hs1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Mixed/Shape.hs b/src/Data/Array/Nested/Mixed/Shape.hs
index 3f4ee9a..f08b8be 100644
--- a/src/Data/Array/Nested/Mixed/Shape.hs
+++ b/src/Data/Array/Nested/Mixed/Shape.hs
@@ -434,6 +434,7 @@ shxToList list = build (\(cons :: i -> is -> is) (nil :: is) ->
go (smn :$% sh) = fromSMayNat' smn `cons` go sh
in go list)
+-- If it ever matters for performance, this is unsafeCoercible.
shxFromSSX :: StaticShX (MapJust sh) -> ShX (MapJust sh) i
shxFromSSX ZKX = ZSX
shxFromSSX (SKnown n :!% sh :: StaticShX (MapJust sh))