Added RULES that translates "unsafeFromForeignPtr fp 0 n" to "unsafeFromForeignPtr0...
[darcs-mirrors/vector.git] / Data / Vector / Storable / Mutable.hs
index 8c3e284..7b87986 100644 (file)
@@ -403,6 +403,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 mutable vector from a 'ForeignPtr' and a length.
 --
 -- It is assumed the pointer points directly to the data (no offset).