@@ -280,7 +280,7 @@ mapColumn f = \case
280280 | Just Refl <- testEquality (typeRep @ a ) (typeRep @ b ) ->
281281 Right $ case sUnbox @ c of
282282 STrue -> UnboxedColumn (VU. map f col)
283- SFalse -> fromVector @ c (VB. map f ( VB. convert col))
283+ SFalse -> fromVector @ c (VB. generate ( VU. length col) (f . VU. unsafeIndex col))
284284 | otherwise ->
285285 Left $
286286 TypeMismatchException
@@ -291,6 +291,10 @@ mapColumn f = \case
291291 , errorColumnName = Nothing
292292 }
293293 )
294+ {-# SPECIALIZE mapColumn ::
295+ (Double -> Double) -> Column -> Either DataFrameException Column
296+ #-}
297+ {-# INLINEABLE mapColumn #-}
294298
295299-- | O(1) Gets the number of elements in the column.
296300columnLength :: Column -> Int
@@ -1347,7 +1351,7 @@ toUnboxedVector column =
13471351 ( MkTypeErrorContext
13481352 { userType = Right (typeRep @ Int )
13491353 , expectedType = Right (typeRep @ a )
1350- , callingFunctionName = Just " toIntVector "
1354+ , callingFunctionName = Just " toUnboxedVector "
13511355 , errorColumnName = Nothing
13521356 }
13531357 )
@@ -1361,3 +1365,7 @@ toUnboxedVector column =
13611365 , errorColumnName = Nothing
13621366 }
13631367 )
1368+ {-# SPECIALIZE toUnboxedVector ::
1369+ Column -> Either DataFrameException (VU.Vector Double)
1370+ #-}
1371+ {-# INLINE toUnboxedVector #-}
0 commit comments