+indexWord32OffAddr :: Addr -> Int -> Word32
+indexWord32OffAddr (A# a#) i = wordToWord32 (W# (indexWordOffAddr# a# i'#))
+ where
+ -- adjust index to be in Word units, not Word32 ones.
+ (I# i'#)
+#if WORD_SIZE_IN_BYTES==8
+ = i `div` 2
+#else
+ = i
+#endif
+
+indexWord64OffAddr :: Addr -> Int -> Word64
+indexWord64OffAddr (A# a#) (I# i#)
+#if WORD_SIZE_IN_BYTES==8
+ = W64# (indexWordOffAddr# a# i#)
+#else
+ = W64# (indexWord64OffAddr# a# i#)
+#endif
+
+#ifndef __PARALLEL_HASKELL__
+
+indexWord8OffForeignObj :: ForeignObj -> Int -> Word8
+indexWord8OffForeignObj (ForeignObj fo#) (I# i#) = intToWord8 (I# (ord# (indexCharOffForeignObj# fo# i#)))
+