Make null fuse properly
authorRoman Leshchinskiy <rl@cse.unsw.edu.au>
Wed, 17 Feb 2010 13:12:00 +0000 (13:12 +0000)
committerRoman Leshchinskiy <rl@cse.unsw.edu.au>
Wed, 17 Feb 2010 13:12:00 +0000 (13:12 +0000)
Data/Vector/Generic.hs

index 72a807d..09e5149 100644 (file)
@@ -280,8 +280,15 @@ length v = basicLength v
   #-}
 
 null :: Vector v a => v a -> Bool
-{-# INLINE null #-}
-null v = length v == 0
+{-# INLINE_STREAM null #-}
+null v = basicLength v == 0
+
+{-# RULES
+
+"null/unstream [Vector]" forall v s.
+  null (new' v (New.unstream s)) = Stream.null s
+
+  #-}
 
 -- Construction
 -- ------------