Added RULES that translates "unsafeFromForeignPtr fp 0 n" to "unsafeFromForeignPtr0...
[darcs-mirrors/vector.git] / Data / Vector / Storable.hs
index 65af6d7..ebb68e1 100644 (file)
@@ -1375,6 +1375,11 @@ unsafeFromForeignPtr fp i n = unsafeFromForeignPtr0 fp' n
     where
       fp' = updPtr (`advancePtr` i) fp
 
+{-# RULES
+"unsafeFromForeignPtr fp 0 n -> unsafeFromForeignPtr0 fp n " forall fp n.
+  unsafeFromForeignPtr fp 0 n = unsafeFromForeignPtr0 fp n
+  #-}
+
 -- | /O(1)/ Create a vector from a 'ForeignPtr' and a length.
 --
 -- It is assumed the pointer points directly to the data (no offset).