aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikolaj Konarski <mikolaj.konarski@funktory.com>2025-12-08 23:41:47 +0100
committerMikolaj Konarski <mikolaj.konarski@funktory.com>2025-12-09 01:07:41 +0100
commit3594dd9855efbcbfd8c1e62037e8c8a7ece93411 (patch)
tree54900c70605cd2f8820dd5b114dcdebd22e0b75b
parent4cd80d336f78b419e9e1b80c2c20e0e07ecf10a0 (diff)
Add INLINEABLE to ixxToLinear ahead of generalization, to benchmark
No horde-ad test speedup noticed.
-rw-r--r--src/Data/Array/Nested/Mixed/Shape.hs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Data/Array/Nested/Mixed/Shape.hs b/src/Data/Array/Nested/Mixed/Shape.hs
index c999853..145ea5f 100644
--- a/src/Data/Array/Nested/Mixed/Shape.hs
+++ b/src/Data/Array/Nested/Mixed/Shape.hs
@@ -36,7 +36,7 @@ import Data.Functor.Product
import Data.Kind (Constraint, Type)
import Data.Monoid (Sum(..))
import Data.Type.Equality
-import GHC.Exts (Int(..), Int#, quotRemInt#, withDict, build)
+import GHC.Exts (Int(..), Int#, build, quotRemInt#, withDict)
import GHC.Generics (Generic)
import GHC.IsList (IsList)
import GHC.IsList qualified as IsList
@@ -284,6 +284,7 @@ ixxZipWith :: (i -> j -> k) -> IxX sh i -> IxX sh j -> IxX sh k
ixxZipWith _ ZIX ZIX = ZIX
ixxZipWith f (i :.% is) (j :.% js) = f i j :.% ixxZipWith f is js
+{-# INLINEABLE ixxToLinear #-}
ixxToLinear :: IShX sh -> IIxX sh -> Int
ixxToLinear = \sh i -> fst (go sh i)
where