diff options
| author | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2025-12-24 19:31:38 +0100 |
|---|---|---|
| committer | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2026-02-12 10:16:29 +0100 |
| commit | 653ad3cb2cb84ff30eb33b3d3832852a419981a7 (patch) | |
| tree | f2abdba982e6857ed5203e55eaa833439c1ed5d2 /src/Data/Array/Nested/Shaped.hs | |
| parent | 44d15b0b38d00df5dece3cba0a9dc749371aceb0 (diff) | |
Inline most lifting wrappers
This results in only marginal performance gain, probably because
they are already small enough to be specialized and/or inlined
automatically, but these pragmas ensure it remains so regardless
of changes in GHC heuristics.
Diffstat (limited to 'src/Data/Array/Nested/Shaped.hs')
| -rw-r--r-- | src/Data/Array/Nested/Shaped.hs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Data/Array/Nested/Shaped.hs b/src/Data/Array/Nested/Shaped.hs index d23a025..a0addec 100644 --- a/src/Data/Array/Nested/Shaped.hs +++ b/src/Data/Array/Nested/Shaped.hs @@ -81,6 +81,7 @@ sgeneratePrim sh f = in sfromVector sh $ VS.generate (shsSize sh) g -- | See the documentation of 'mlift'. +{-# INLINE slift #-} slift :: forall sh1 sh2 a. Elt a => ShS sh2 -> (forall sh' b. Storable b => StaticShX sh' -> XArray (MapJust sh1 ++ sh') b -> XArray (MapJust sh2 ++ sh') b) @@ -88,6 +89,7 @@ slift :: forall sh1 sh2 a. Elt a slift sh2 f (Shaped arr) = Shaped (mlift (ssxFromShX (shxFromShS sh2)) f arr) -- | See the documentation of 'mlift'. +{-# INLINE slift2 #-} slift2 :: forall sh1 sh2 sh3 a. Elt a => ShS sh3 -> (forall sh' b. Storable b => StaticShX sh' -> XArray (MapJust sh1 ++ sh') b -> XArray (MapJust sh2 ++ sh') b -> XArray (MapJust sh3 ++ sh') b) |
