Commits

Bryan O'Sullivan committed 1086a63

Minor cleanups

  • Participants
  • Parent commits c13d91a

Comments (0)

Files changed (2)

File Data/Text/Lazy.hs

 --
 -- This function is subject to array fusion.
 pack :: String -> Text
-pack = unstream . S.streamList
+pack s = unstream (S.streamList s)
 {-# INLINE [1] pack #-}
 
 -- | /O(n)/ Convert a 'Text' into a 'String'.
 -- Subject to array fusion.
 unpack :: Text -> String
-unpack = S.unstreamList . stream
+unpack t = S.unstreamList (stream t)
 {-# INLINE [1] unpack #-}
 
 singleton :: Char -> Text
 {-# INLINE [1] singleton #-}
 
 {-# RULES
-"TEXT singleton -> fused" [~1] forall c.
+"LAZY TEXT singleton -> fused" [~1] forall c.
     singleton c = unstream (S.singleton c)
-"TEXT singleton -> unfused" [1] forall c.
+"LAZY TEXT singleton -> unfused" [1] forall c.
     unstream (S.singleton c) = singleton c
   #-}
 
 {-# INLINE append #-}
 
 {-# RULES
-"TEXT append -> fused" [~1] forall t1 t2.
+"LAZY TEXT append -> fused" [~1] forall t1 t2.
     append t1 t2 = unstream (S.append (stream t1) (stream t2))
-"TEXT append -> unfused" [1] forall t1 t2.
+"LAZY TEXT append -> unfused" [1] forall t1 t2.
     unstream (S.append (stream t1) (stream t2)) = append t1 t2
  #-}
 

File Data/Text/Lazy/Fusion.hs

 unstream = unstreamChunks defaultChunkSize
 {-# INLINE [0] unstream #-}
 
-{-# RULES "STREAM stream/unstream fusion" forall s. stream (unstream s) = s #-}
+{-# RULES "LAZY STREAM stream/unstream fusion" forall s.
+    stream (unstream s) = s #-}