@@ -104,7 +104,7 @@ singleton c = Stream next False 1 -- HINT maybe too low
104{-# INLINE singleton #-}
104{-# INLINE singleton #-}
106streamList :: [a] -> Stream a
106streamList :: [a] -> Stream a
107−{-# INLINE streamList #-}
107+{-# INLINE [0] streamList #-}
108streamList [] = empty
108streamList [] = empty
109streamList s = Stream next s unknownLength
109streamList s = Stream next s unknownLength
110 where next [] = Done
110 where next [] = Done
@@ -112,13 +112,15 @@ streamList s = Stream next s unknownLength
112 unknownLength = 8 -- random HINT
112 unknownLength = 8 -- random HINT
114unstreamList :: Stream a -> [a]
114unstreamList :: Stream a -> [a]
115−{-# INLINE unstreamList #-}
115+{-# INLINE [0] unstreamList #-}
116unstreamList (Stream next s0 _len) = unfold s0
116unstreamList (Stream next s0 _len) = unfold s0
117 where unfold !s = case next s of
117 where unfold !s = case next s of
118 Done -> []
118 Done -> []
119 Skip s' -> unfold s'
119 Skip s' -> unfold s'
120 Yield x s' -> x : unfold s'
120 Yield x s' -> x : unfold s'
122+{-# RULES "STREAM streamList/unstreamList fusion" forall s. streamList (unstreamList s) = s #-}
122-- ----------------------------------------------------------------------------
124-- ----------------------------------------------------------------------------
123-- * Basic stream functions
125-- * Basic stream functions